diff --git a/.cspell.json b/.cspell.json index daf674b70f3..6d9aecc3a60 100644 --- a/.cspell.json +++ b/.cspell.json @@ -77,6 +77,8 @@ "Premade", "prettier's", "recurse", + "redeclaration", + "redeclarations", "redeclared", "reimplement", "resync", diff --git a/.eslintrc.js b/.eslintrc.js index 6e70052cdfd..5fbcecbe066 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -214,6 +214,7 @@ module.exports = { 'packages/eslint-plugin-internal/tests/rules/**/*.test.ts', 'packages/eslint-plugin-tslint/tests/rules/**/*.test.ts', 'packages/eslint-plugin/tests/rules/**/*.test.ts', + 'packages/eslint-plugin/tests/eslint-rules/**/*.test.ts', ], rules: { '@typescript-eslint/internal/plugin-test-formatting': 'error', diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 031db693794..502551bf8d9 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -145,7 +145,6 @@ Pro Tip: For larger codebases you may want to consider splitting our linting int | [`@typescript-eslint/no-unsafe-call`](./docs/rules/no-unsafe-call.md) | Disallows calling an any type value | :heavy_check_mark: | | :thought_balloon: | | [`@typescript-eslint/no-unsafe-member-access`](./docs/rules/no-unsafe-member-access.md) | Disallows member access on any typed variables | :heavy_check_mark: | | :thought_balloon: | | [`@typescript-eslint/no-unsafe-return`](./docs/rules/no-unsafe-return.md) | Disallows returning any from a function | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/no-unused-vars-experimental`](./docs/rules/no-unused-vars-experimental.md) | Disallow unused variables and arguments | | | | | [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :heavy_check_mark: | | | | [`@typescript-eslint/prefer-as-const`](./docs/rules/prefer-as-const.md) | Prefer usage of `as const` over literal type | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/prefer-enum-initializers`](./docs/rules/prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | @@ -185,34 +184,36 @@ In these cases, we create what we call an extension rule; a rule within our plug **Key**: :heavy_check_mark: = recommended, :wrench: = fixable, :thought_balloon: = requires type information -| Name | Description | :heavy_check_mark: | :wrench: | :thought_balloon: | -| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------ | -------- | ----------------- | -| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | -| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | -| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | -| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | -| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | -| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | -| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | -| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | -| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | -| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | | -| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | disallow `this` keywords outside of classes or class-like objects | | | | -| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | | | | -| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | -| [`@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 | | | | -| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | -| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | -| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :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) | Enforces consistent spacing before function parenthesis | | :wrench: | | +| Name | Description | :heavy_check_mark: | :wrench: | :thought_balloon: | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------ | -------- | ----------------- | +| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | +| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | +| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | +| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | +| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | +| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | +| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | +| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | +| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | +| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | | +| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | +| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | disallow `this` keywords outside of classes or class-like objects | | | | +| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | | | | +| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | +| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | +| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | +| [`@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 | | | | +| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | +| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | +| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :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) | Enforces consistent spacing before function parenthesis | | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/no-redeclare.md b/packages/eslint-plugin/docs/rules/no-redeclare.md new file mode 100644 index 00000000000..a794250d6f1 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-redeclare.md @@ -0,0 +1,69 @@ +# Disallow variable redeclaration (`no-redeclare`) + +## Rule Details + +This rule extends the base [`eslint/no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule. +It adds support for TypeScript function overloads, and declaration merging. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-redeclare": "off", + "@typescript-eslint/no-redeclare": ["error"] +} +``` + +## Options + +See [`eslint/no-redeclare` options](https://eslint.org/docs/rules/no-redeclare#options). +This rule adds the following options: + +```ts +interface Options extends BaseNoShadowOptions { + ignoreDeclarationMerge?: boolean; +} + +const defaultOptions: Options = { + ...baseNoShadowDefaultOptions, + ignoreDeclarationMerge: true, +}; +``` + +### `ignoreDeclarationMerge` + +When set to `true`, the rule will ignore declaration merges between the following sets: + +- interface + interface +- namespace + namespace +- class + interface +- class + namespace +- class + interface + namespace +- function + namespace + +Examples of **correct** code with `{ ignoreDeclarationMerge: true }`: + +```ts +interface A { + prop1: 1; +} +interface A { + prop2: 2; +} + +namespace Foo { + export const a = 1; +} +namespace Foo { + export const b = 2; +} + +class Bar {} +namespace Bar {} + +function Baz() {} +namespace Baz {} +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-redeclare.md) diff --git a/packages/eslint-plugin/docs/rules/no-shadow.md b/packages/eslint-plugin/docs/rules/no-shadow.md new file mode 100644 index 00000000000..d4b5294696a --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-shadow.md @@ -0,0 +1,50 @@ +# Disallow variable declarations from shadowing variables declared in the outer scope (`no-shadow`) + +## Rule Details + +This rule extends the base [`eslint/no-shadow`](https://eslint.org/docs/rules/no-shadow) rule. +It adds support for TypeScript's `this` parameters, and adds options for TypeScript features. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-shadow": "off", + "@typescript-eslint/no-shadow": ["error"] +} +``` + +## Options + +See [`eslint/no-shadow` options](https://eslint.org/docs/rules/no-shadow#options). +This rule adds the following options: + +```ts +interface Options extends BaseNoShadowOptions { + ignoreTypeValueShadow?: boolean; +} + +const defaultOptions: Options = { + ...baseNoShadowDefaultOptions, + ignoreTypeValueShadow: true, +}; +``` + +### `ignoreTypeValueShadow` + +When set to `true`, the rule will ignore when you name a type and a variable with the same name. + +Examples of **correct** code with `{ ignoreTypeValueShadow: true }`: + +```ts +type Foo = number; +const Foo = 1; + +interface Bar { + prop: number; +} +const Bar = 'test'; +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-shadow.md) diff --git a/packages/eslint-plugin/docs/rules/no-unused-vars.md b/packages/eslint-plugin/docs/rules/no-unused-vars.md index 44cfae690f8..5eaf167a379 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-vars.md +++ b/packages/eslint-plugin/docs/rules/no-unused-vars.md @@ -1,7 +1,5 @@ # Disallow unused variables (`no-unused-vars`) -## PLEASE READ THIS ISSUE BEFORE USING THIS RULE [#1856](https://github.com/typescript-eslint/typescript-eslint/issues/1856) - ## Rule Details This rule extends the base [`eslint/no-unused-vars`](https://eslint.org/docs/rules/no-unused-vars) rule. diff --git a/packages/eslint-plugin/docs/rules/no-use-before-define.md b/packages/eslint-plugin/docs/rules/no-use-before-define.md index 569b8130386..dfdab4d60f7 100644 --- a/packages/eslint-plugin/docs/rules/no-use-before-define.md +++ b/packages/eslint-plugin/docs/rules/no-use-before-define.md @@ -23,42 +23,34 @@ See [`eslint/no-use-before-define` options](https://eslint.org/docs/rules/no-use This rule adds the following options: ```ts -interface Options extends BaseNoMagicNumbersOptions { +interface Options extends BaseNoUseBeforeDefineOptions { enums?: boolean; typedefs?: boolean; + ignoreTypeReferences?: boolean; } const defaultOptions: Options = { - ...baseNoMagicNumbersDefaultOptions, + ...baseNoUseBeforeDefineDefaultOptions, enums: true, typedefs: true, + ignoreTypeReferences: true, }; ``` ### `enums` -The flag which shows whether or not this rule checks enum declarations of upper scopes. If this is `true`, this rule warns every reference to a enum before the enum declaration. -Otherwise, ignores those references. +If this is `false`, this rule will ignore references to enums, when the reference is in a child scope. -Examples of **incorrect** code for the `{ "enums": true }` option: +Examples of **incorrect** code for the `{ "enums": false }` option: ```ts -/*eslint no-use-before-define: ["error", { "enums": true }]*/ +/*eslint no-use-before-define: ["error", { "enums": false }]*/ -function foo() { - return Foo.FOO; -} - -class Test { - foo() { - return Foo.FOO; - } -} +const x = Foo.FOO; enum Foo { FOO, - BAR, } ``` @@ -78,10 +70,8 @@ enum Foo { ### `typedefs` -The flag which shows whether or not this rule checks type declarations. If this is `true`, this rule warns every reference to a type before the type declaration. -Otherwise, ignores those references. -Type declarations are hoisted, so it's safe. +If this is `false`, this rule will ignore references to types. Examples of **correct** code for the `{ "typedefs": false }` option: @@ -92,4 +82,25 @@ let myVar: StringOrNumber; type StringOrNumber = string | number; ``` -Copied from [the original ESLint rule docs](https://github.com/eslint/eslint/blob/a113cd3/docs/rules/no-use-before-define.md) +### `ignoreTypeReferences` + +If this is `true`, this rule ignores all type references, such as in type annotations and assertions. +If this is `false`, this will will check all type references. + +Examples of **correct** code for the `{ "ignoreTypeReferences": true }` option: + +```ts +/*eslint no-use-before-define: ["error", { "ignoreTypeReferences": true }]*/ + +let var1: StringOrNumber; +type StringOrNumber = string | number; + +let var2: Enum; +enum Enum {} +``` + +### Other Options + +See [`eslint/no-use-before-define` options](https://eslint.org/docs/rules/no-use-before-define#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-use-before-define.md) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 079fefb2668..c6f95ada07d 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -43,6 +43,7 @@ }, "dependencies": { "@typescript-eslint/experimental-utils": "3.10.1", + "@typescript-eslint/scope-manager": "3.10.1", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", diff --git a/packages/eslint-plugin/src/configs/all.ts b/packages/eslint-plugin/src/configs/all.ts index c0105c354c2..10654255245 100644 --- a/packages/eslint-plugin/src/configs/all.ts +++ b/packages/eslint-plugin/src/configs/all.ts @@ -74,7 +74,11 @@ export = { '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', '@typescript-eslint/no-non-null-assertion': 'error', '@typescript-eslint/no-parameter-properties': 'error', + 'no-redeclare': 'off', + '@typescript-eslint/no-redeclare': 'error', '@typescript-eslint/no-require-imports': 'error', + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/no-this-alias': 'error', '@typescript-eslint/no-throw-literal': 'error', '@typescript-eslint/no-type-alias': 'error', @@ -91,7 +95,6 @@ export = { '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', - '@typescript-eslint/no-unused-vars-experimental': 'error', 'no-use-before-define': 'off', '@typescript-eslint/no-use-before-define': 'error', 'no-useless-constructor': 'off', diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 63acccee914..6386c317e3d 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -51,7 +51,9 @@ import noNamespace from './no-namespace'; import noNonNullAssertedOptionalChain from './no-non-null-asserted-optional-chain'; import noNonNullAssertion from './no-non-null-assertion'; import noParameterProperties from './no-parameter-properties'; +import noRedeclare from './no-redeclare'; import noRequireImports from './no-require-imports'; +import noShadow from './no-shadow'; import noThisAlias from './no-this-alias'; import noThrowLiteral from './no-throw-literal'; import noTypeAlias from './no-type-alias'; @@ -152,7 +154,9 @@ export default { 'no-non-null-asserted-optional-chain': noNonNullAssertedOptionalChain, 'no-non-null-assertion': noNonNullAssertion, 'no-parameter-properties': noParameterProperties, + 'no-redeclare': noRedeclare, 'no-require-imports': noRequireImports, + 'no-shadow': noShadow, 'no-this-alias': noThisAlias, 'no-throw-literal': noThrowLiteral, 'no-type-alias': noTypeAlias, diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts index 817d1232be2..11ed8582c75 100644 --- a/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -1,8 +1,5 @@ import * as util from '../util'; -import { - AST_NODE_TYPES, - TSESLint, -} from '@typescript-eslint/experimental-utils'; +import { TSESLint } from '@typescript-eslint/experimental-utils'; type Options = [ { @@ -81,12 +78,7 @@ export default util.createRule({ let useAutoFix = true; if (util.isDefinitionFile(filename)) { const scope = context.getScope(); - if ( - scope.block.parent && - scope.block.parent.type === - AST_NODE_TYPES.TSModuleDeclaration && - scope.block.parent.declare - ) { + if (scope.type === 'tsModule' && scope.block.declare) { useAutoFix = false; } } diff --git a/packages/eslint-plugin/src/rules/no-redeclare.ts b/packages/eslint-plugin/src/rules/no-redeclare.ts new file mode 100644 index 00000000000..d85cb1dc241 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-redeclare.ts @@ -0,0 +1,297 @@ +import { + TSESTree, + TSESLint, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import * as util from '../util'; + +type MessageIds = 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax'; +type Options = [ + { + builtinGlobals?: boolean; + ignoreDeclarationMerge?: boolean; + }, +]; + +// https://github.com/lodash/lodash/blob/86a852fe763935bb64c12589df5391fd7d3bb14d/escapeRegExp.js +const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +const reHasRegExpChar = RegExp(reRegExpChar.source); +function escapeRegExp(str: string): string { + return str && reHasRegExpChar.test(str) + ? str.replace(reRegExpChar, '\\$&') + : str || ''; +} + +function getNameLocationInGlobalDirectiveComment( + sourceCode: TSESLint.SourceCode, + comment: TSESTree.Comment, + name: string, +): TSESTree.SourceLocation { + const namePattern = new RegExp( + `[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`, + 'gu', + ); + + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf('global') + 6; + + // Search a given variable name. + const match = namePattern.exec(comment.value); + + // Convert the index to loc. + const start = sourceCode.getLocFromIndex( + comment.range[0] + '/*'.length + (match ? match.index + 1 : 0), + ); + const end = { + line: start.line, + column: start.column + (match ? name.length : 1), + }; + + return { start, end }; +} + +export default util.createRule({ + name: 'no-redeclare', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow variable redeclaration', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + schema: [ + { + type: 'object', + properties: { + builtinGlobals: { + type: 'boolean', + }, + ignoreDeclarationMerge: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + messages: { + redeclared: "'{{id}}' is already defined.", + redeclaredAsBuiltin: + "'{{id}}' is already defined as a built-in global variable.", + redeclaredBySyntax: + "'{{id}}' is already defined by a variable declaration.", + }, + }, + defaultOptions: [ + { + builtinGlobals: true, + ignoreDeclarationMerge: true, + }, + ], + create(context, [options]) { + const sourceCode = context.getSourceCode(); + + const CLASS_DECLARATION_MERGE_NODES = new Set([ + AST_NODE_TYPES.TSInterfaceDeclaration, + AST_NODE_TYPES.TSModuleDeclaration, + AST_NODE_TYPES.ClassDeclaration, + ]); + const FUNCTION_DECLARATION_MERGE_NODES = new Set([ + AST_NODE_TYPES.TSModuleDeclaration, + AST_NODE_TYPES.FunctionDeclaration, + ]); + + function* iterateDeclarations( + variable: TSESLint.Scope.Variable, + ): Generator< + { + type: 'builtin' | 'syntax' | 'comment'; + node?: TSESTree.Identifier | TSESTree.Comment; + loc?: TSESTree.SourceLocation; + }, + void, + unknown + > { + if ( + options?.builtinGlobals && + 'eslintImplicitGlobalSetting' in variable && + (variable.eslintImplicitGlobalSetting === 'readonly' || + variable.eslintImplicitGlobalSetting === 'writable') + ) { + yield { type: 'builtin' }; + } + + if ( + 'eslintExplicitGlobalComments' in variable && + variable.eslintExplicitGlobalComments + ) { + for (const comment of variable.eslintExplicitGlobalComments) { + yield { + type: 'comment', + node: comment, + loc: getNameLocationInGlobalDirectiveComment( + sourceCode, + comment, + variable.name, + ), + }; + } + } + + const identifiers = variable.identifiers + .map(id => ({ + identifier: id, + parent: id.parent!, + })) + // ignore function declarations because TS will treat them as an overload + .filter( + ({ parent }) => parent.type !== AST_NODE_TYPES.TSDeclareFunction, + ); + + if (options.ignoreDeclarationMerge && identifiers.length > 1) { + if ( + // interfaces merging + identifiers.every( + ({ parent }) => + parent.type === AST_NODE_TYPES.TSInterfaceDeclaration, + ) + ) { + return; + } + + if ( + // namespace/module merging + identifiers.every( + ({ parent }) => parent.type === AST_NODE_TYPES.TSModuleDeclaration, + ) + ) { + return; + } + + if ( + // class + interface/namespace merging + identifiers.every(({ parent }) => + CLASS_DECLARATION_MERGE_NODES.has(parent.type), + ) + ) { + const classDecls = identifiers.filter( + ({ parent }) => parent.type === AST_NODE_TYPES.ClassDeclaration, + ); + if (classDecls.length === 1) { + // safe declaration merging + return; + } + + // there's more than one class declaration, which needs to be reported + for (const { identifier } of classDecls) { + yield { type: 'syntax', node: identifier, loc: identifier.loc }; + } + return; + } + + if ( + // class + interface/namespace merging + identifiers.every(({ parent }) => + FUNCTION_DECLARATION_MERGE_NODES.has(parent.type), + ) + ) { + const functionDecls = identifiers.filter( + ({ parent }) => parent.type === AST_NODE_TYPES.FunctionDeclaration, + ); + if (functionDecls.length === 1) { + // safe declaration merging + return; + } + + // there's more than one class declaration, which needs to be reported + for (const { identifier } of functionDecls) { + yield { type: 'syntax', node: identifier, loc: identifier.loc }; + } + return; + } + } + + for (const { identifier } of identifiers) { + yield { type: 'syntax', node: identifier, loc: identifier.loc }; + } + } + + function findVariablesInScope(scope: TSESLint.Scope.Scope): void { + for (const variable of scope.variables) { + const [declaration, ...extraDeclarations] = iterateDeclarations( + variable, + ); + + if (extraDeclarations.length === 0) { + continue; + } + + /* + * If the type of a declaration is different from the type of + * the first declaration, it shows the location of the first + * declaration. + */ + const detailMessageId = + declaration.type === 'builtin' + ? 'redeclaredAsBuiltin' + : 'redeclaredBySyntax'; + const data = { id: variable.name }; + + // Report extra declarations. + for (const { type, node, loc } of extraDeclarations) { + const messageId = + type === declaration.type ? 'redeclared' : detailMessageId; + + if (node) { + context.report({ node, loc, messageId, data }); + } else if (loc) { + context.report({ loc, messageId, data }); + } + } + } + } + + /** + * Find variables in the current scope. + */ + function checkForBlock(node: TSESTree.Node): void { + const scope = context.getScope(); + + /* + * In ES5, some node type such as `BlockStatement` doesn't have that scope. + * `scope.block` is a different node in such a case. + */ + if (scope.block === node) { + findVariablesInScope(scope); + } + } + + return { + Program(): void { + const scope = context.getScope(); + + findVariablesInScope(scope); + + // Node.js or ES modules has a special scope. + if ( + scope.type === 'global' && + scope.childScopes[0] && + // The special scope's block is the Program node. + scope.block === scope.childScopes[0].block + ) { + findVariablesInScope(scope.childScopes[0]); + } + }, + + FunctionDeclaration: checkForBlock, + FunctionExpression: checkForBlock, + ArrowFunctionExpression: checkForBlock, + + BlockStatement: checkForBlock, + ForStatement: checkForBlock, + ForInStatement: checkForBlock, + ForOfStatement: checkForBlock, + SwitchStatement: checkForBlock, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts new file mode 100644 index 00000000000..aab60bc8163 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-shadow.ts @@ -0,0 +1,284 @@ +import { + TSESTree, + TSESLint, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import * as util from '../util'; + +type MessageIds = 'noShadow'; +type Options = [ + { + allow?: string[]; + builtinGlobals?: boolean; + hoist?: 'all' | 'functions' | 'never'; + ignoreTypeValueShadow?: boolean; + }, +]; + +export default util.createRule({ + name: 'no-shadow', + meta: { + type: 'suggestion', + docs: { + description: + 'Disallow variable declarations from shadowing variables declared in the outer scope', + category: 'Variables', + recommended: false, + extendsBaseRule: true, + }, + schema: [ + { + type: 'object', + properties: { + builtinGlobals: { + type: 'boolean', + }, + hoist: { + enum: ['all', 'functions', 'never'], + }, + allow: { + type: 'array', + items: { + type: 'string', + }, + }, + ignoreTypeValueShadow: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + messages: { + noShadow: "'{{name}}' is already declared in the upper scope.", + }, + }, + defaultOptions: [ + { + allow: [], + builtinGlobals: false, + hoist: 'functions', + ignoreTypeValueShadow: true, + }, + ], + create(context, [options]) { + /** + * Check if variable is a `this` parameter. + */ + function isThisParam(variable: TSESLint.Scope.Variable): boolean { + return variable.defs[0].type === 'Parameter' && variable.name === 'this'; + } + + function isTypeValueShadow( + variable: TSESLint.Scope.Variable, + shadowed: TSESLint.Scope.Variable, + ): boolean { + if (options.ignoreTypeValueShadow !== true) { + return false; + } + + if ( + !('isValueVariable' in shadowed) || + !('isValueVariable' in variable) + ) { + // one of them is an eslint global variable + return false; + } + + return variable.isValueVariable !== shadowed.isValueVariable; + } + + /** + * Check if variable name is allowed. + * @param variable The variable to check. + * @returns Whether or not the variable name is allowed. + */ + function isAllowed(variable: TSESLint.Scope.Variable): boolean { + return options.allow!.indexOf(variable.name) !== -1; + } + + /** + * Checks if a variable of the class name in the class scope of ClassDeclaration. + * + * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param variable The variable to check. + * @returns Whether or not the variable of the class name in the class scope of ClassDeclaration. + */ + function isDuplicatedClassNameVariable( + variable: TSESLint.Scope.Variable, + ): boolean { + const block = variable.scope.block; + + return ( + block.type === AST_NODE_TYPES.ClassDeclaration && + block.id === variable.identifiers[0] + ); + } + + /** + * Checks if a variable is inside the initializer of scopeVar. + * + * To avoid reporting at declarations such as `var a = function a() {};`. + * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. + * @param variable The variable to check. + * @param scopeVar The scope variable to look for. + * @returns Whether or not the variable is inside initializer of scopeVar. + */ + function isOnInitializer( + variable: TSESLint.Scope.Variable, + scopeVar: TSESLint.Scope.Variable, + ): boolean { + const outerScope = scopeVar.scope; + const outerDef = scopeVar.defs[0]; + const outer = outerDef?.parent?.range; + const innerScope = variable.scope; + const innerDef = variable.defs[0]; + const inner = innerDef?.name.range; + + return !!( + outer && + inner && + outer[0] < inner[0] && + inner[1] < outer[1] && + ((innerDef.type === 'FunctionName' && + innerDef.node.type === AST_NODE_TYPES.FunctionExpression) || + innerDef.node.type === AST_NODE_TYPES.ClassExpression) && + outerScope === innerScope.upper + ); + } + + /** + * Get a range of a variable's identifier node. + * @param variable The variable to get. + * @returns The range of the variable's identifier node. + */ + function getNameRange( + variable: TSESLint.Scope.Variable, + ): TSESTree.Range | undefined { + const def = variable.defs[0]; + return def?.name.range; + } + + /** + * Checks if a variable is in TDZ of scopeVar. + * @param variable The variable to check. + * @param scopeVar The variable of TDZ. + * @returns Whether or not the variable is in TDZ of scopeVar. + */ + function isInTdz( + variable: TSESLint.Scope.Variable, + scopeVar: TSESLint.Scope.Variable, + ): boolean { + const outerDef = scopeVar.defs[0]; + const inner = getNameRange(variable); + const outer = getNameRange(scopeVar); + + return !!( + inner && + outer && + inner[1] < outer[0] && + // Excepts FunctionDeclaration if is {"hoist":"function"}. + (options.hoist !== 'functions' || + !outerDef || + outerDef.node.type !== AST_NODE_TYPES.FunctionDeclaration) + ); + } + + /** + * Finds the variable by a given name in a given scope and its upper scopes. + * @param initScope A scope to start find. + * @param name A variable name to find. + * @returns A found variable or `null`. + */ + function getVariableByName( + initScope: TSESLint.Scope.Scope | null, + name: string, + ): TSESLint.Scope.Variable | null { + let scope = initScope; + + while (scope) { + const variable = scope.set.get(name); + + if (variable) { + return variable; + } + + scope = scope.upper; + } + + return null; + } + + /** + * Checks the current context for shadowed variables. + * @param {Scope} scope Fixme + */ + function checkForShadows(scope: TSESLint.Scope.Scope): void { + const variables = scope.variables; + + for (const variable of variables) { + // ignore "arguments" + if (variable.identifiers.length === 0) { + continue; + } + + // this params are pseudo-params that cannot be shadowed + if (isThisParam(variable)) { + continue; + } + + // ignore variables of a class name in the class scope of ClassDeclaration + if (isDuplicatedClassNameVariable(variable)) { + continue; + } + + // ignore configured allowed names + if (isAllowed(variable)) { + continue; + } + + // Gets shadowed variable. + const shadowed = getVariableByName(scope.upper, variable.name); + if (!shadowed) { + continue; + } + + // ignore type value variable shadowing if configured + if (isTypeValueShadow(variable, shadowed)) { + continue; + } + + const isESLintGlobal = 'writeable' in shadowed; + if ( + (shadowed.identifiers.length > 0 || + (options.builtinGlobals && isESLintGlobal)) && + !isOnInitializer(variable, shadowed) && + !(options.hoist !== 'all' && isInTdz(variable, shadowed)) + ) { + context.report({ + node: variable.identifiers[0], + messageId: 'noShadow', + data: { + name: variable.name, + }, + }); + } + } + } + + return { + 'Program:exit'(): void { + const globalScope = context.getScope(); + const stack = globalScope.childScopes.slice(); + + while (stack.length) { + const scope = stack.pop()!; + + stack.push(...scope.childScopes); + checkForShadows(scope); + } + }, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts b/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts index ad7c3f41742..0aedd20cbb2 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts @@ -30,6 +30,8 @@ export default util.createRule({ category: 'Best Practices', recommended: false, }, + deprecated: true, + replacedBy: ['no-unused-vars'], schema: [ { type: 'object', diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 2c3595f3ba2..ad5d597edf5 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -1,7 +1,9 @@ import { - AST_NODE_TYPES, TSESTree, + TSESLint, + AST_NODE_TYPES, } from '@typescript-eslint/experimental-utils'; +import { PatternVisitor } from '@typescript-eslint/scope-manager'; import baseRule from 'eslint/lib/rules/no-unused-vars'; import * as util from '../util'; @@ -21,50 +23,189 @@ export default util.createRule({ schema: baseRule.meta.schema, messages: baseRule.meta.messages, }, - defaultOptions: [], + defaultOptions: [{}], create(context) { const rules = baseRule.create(context); /** - * Mark heritage clause as used - * @param node The node currently being traversed + * Gets a list of TS module definitions for a specified variable. + * @param variable eslint-scope variable object. */ - function markHeritageAsUsed(node: TSESTree.Expression): void { - switch (node.type) { - case AST_NODE_TYPES.Identifier: - context.markVariableAsUsed(node.name); - break; - case AST_NODE_TYPES.MemberExpression: - markHeritageAsUsed(node.object); - break; - case AST_NODE_TYPES.CallExpression: - markHeritageAsUsed(node.callee); - break; + function getModuleNameDeclarations( + variable: TSESLint.Scope.Variable, + ): TSESTree.TSModuleDeclaration[] { + const moduleDeclarations: TSESTree.TSModuleDeclaration[] = []; + + variable.defs.forEach(def => { + if (def.type === 'TSModuleName') { + moduleDeclarations.push(def.node); + } + }); + + return moduleDeclarations; + } + + /** + * Determine if an identifier is referencing an enclosing name. + * This only applies to declarations that create their own scope (modules, functions, classes) + * @param ref The reference to check. + * @param nodes The candidate function nodes. + * @returns True if it's a self-reference, false if not. + */ + function isBlockSelfReference( + ref: TSESLint.Scope.Reference, + nodes: TSESTree.Node[], + ): boolean { + let scope: TSESLint.Scope.Scope | null = ref.from; + + while (scope) { + if (nodes.indexOf(scope.block) >= 0) { + return true; + } + + scope = scope.upper; } + + return false; } - return Object.assign({}, rules, { - 'TSTypeReference Identifier'(node: TSESTree.Identifier) { - context.markVariableAsUsed(node.name); + function isExported( + variable: TSESLint.Scope.Variable, + target: AST_NODE_TYPES, + ): boolean { + // TS will require that all merged namespaces/interfaces are exported, so we only need to find one + return variable.defs.some( + def => + def.node.type === target && + (def.node.parent?.type === AST_NODE_TYPES.ExportNamedDeclaration || + def.node.parent?.type === AST_NODE_TYPES.ExportDefaultDeclaration), + ); + } + + return { + ...rules, + 'TSConstructorType, TSConstructSignatureDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature'( + node: + | TSESTree.TSConstructorType + | TSESTree.TSConstructSignatureDeclaration + | TSESTree.TSDeclareFunction + | TSESTree.TSEmptyBodyFunctionExpression + | TSESTree.TSFunctionType + | TSESTree.TSMethodSignature, + ): void { + // function type signature params create variables because they can be referenced within the signature, + // but they obviously aren't unused variables for the purposes of this rule. + for (const param of node.params) { + visitPattern(param, name => { + context.markVariableAsUsed(name.name); + }); + } }, - TSInterfaceHeritage(node: TSESTree.TSInterfaceHeritage) { - if (node.expression) { - markHeritageAsUsed(node.expression); + TSEnumDeclaration(): void { + // enum members create variables because they can be referenced within the enum, + // but they obviously aren't unused variables for the purposes of this rule. + const scope = context.getScope(); + for (const variable of scope.variables) { + context.markVariableAsUsed(variable.name); } }, - TSClassImplements(node: TSESTree.TSClassImplements) { - if (node.expression) { - markHeritageAsUsed(node.expression); + TSMappedType(node): void { + // mapped types create a variable for their type name, but it's not necessary to reference it, + // so we shouldn't consider it as unused for the purpose of this rule. + context.markVariableAsUsed(node.typeParameter.name.name); + }, + TSModuleDeclaration(): void { + const childScope = context.getScope(); + const scope = util.nullThrows( + context.getScope().upper, + util.NullThrowsReasons.MissingToken(childScope.type, 'upper scope'), + ); + for (const variable of scope.variables) { + const moduleNodes = getModuleNameDeclarations(variable); + + if ( + moduleNodes.length === 0 || + // ignore unreferenced module definitions, as the base rule will report on them + variable.references.length === 0 || + // ignore exported nodes + isExported(variable, AST_NODE_TYPES.TSModuleDeclaration) + ) { + continue; + } + + // check if the only reference to a module's name is a self-reference in its body + // this won't be caught by the base rule because it doesn't understand TS modules + const isOnlySelfReferenced = variable.references.every(ref => { + return isBlockSelfReference(ref, moduleNodes); + }); + + if (isOnlySelfReferenced) { + context.report({ + node: variable.identifiers[0], + messageId: 'unusedVar', + data: { + varName: variable.name, + action: 'defined', + additional: '', + }, + }); + } } }, - 'TSParameterProperty Identifier'(node: TSESTree.Identifier) { - // just assume parameter properties are used + [[ + 'TSParameterProperty > AssignmentPattern > Identifier.left', + 'TSParameterProperty > Identifier.parameter', + ].join(', ')](node: TSESTree.Identifier): void { + // just assume parameter properties are used as property usage tracking is beyond the scope of this rule context.markVariableAsUsed(node.name); }, - 'TSEnumMember Identifier'(node: TSESTree.Identifier) { + ':matches(FunctionDeclaration, FunctionExpression, ArrowFunctionExpression) > Identifier[name="this"].params'( + node: TSESTree.Identifier, + ): void { + // this parameters should always be considered used as they're pseudo-parameters context.markVariableAsUsed(node.name); }, - '*[declare=true] Identifier'(node: TSESTree.Identifier) { + 'TSInterfaceDeclaration, TSTypeAliasDeclaration'( + node: TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration, + ): void { + const variable = context.getScope().set.get(node.id.name); + if (!variable) { + return; + } + if ( + variable.references.length === 0 || + // ignore exported nodes + isExported(variable, node.type) + ) { + return; + } + + // check if the type is only self-referenced + // this won't be caught by the base rule because it doesn't understand self-referencing types + const isOnlySelfReferenced = variable.references.every(ref => { + if ( + ref.identifier.range[0] >= node.range[0] && + ref.identifier.range[1] <= node.range[1] + ) { + return true; + } + return false; + }); + if (isOnlySelfReferenced) { + context.report({ + node: variable.identifiers[0], + messageId: 'unusedVar', + data: { + varName: variable.name, + action: 'defined', + additional: '', + }, + }); + } + }, + + // TODO - this could probably be refined a bit + '*[declare=true] Identifier'(node: TSESTree.Identifier): void { context.markVariableAsUsed(node.name); const scope = context.getScope(); const { variableScope } = scope; @@ -75,6 +216,86 @@ export default util.createRule({ } } }, - }); + }; + + function visitPattern( + node: TSESTree.Node, + cb: (node: TSESTree.Identifier) => void, + ): void { + const visitor = new PatternVisitor({}, node, cb); + visitor.visit(node); + } }, }); + +/* + +###### TODO ###### + +Edge cases that aren't currently handled due to laziness and them being super edgy edge cases + + +--- function params referenced in typeof type refs in the function declaration --- +--- NOTE - TS gets these cases wrong + +function _foo( + arg: number // arg should be unused +): typeof arg { + return 1 as any; +} + +function _bar( + arg: number, // arg should be unused + _arg2: typeof arg, +) {} + + +--- function names referenced in typeof type refs in the function declaration --- +--- NOTE - TS gets these cases right + +function foo( // foo should be unused +): typeof foo { + return 1 as any; +} + +function bar( // bar should be unused + _arg: typeof bar +) {} + +*/ + +/* + +###### TODO ###### + +We currently extend base `no-unused-vars` implementation because it's easier and lighter-weight. + +Because of this, there are a few false-negatives which won't get caught. +We could fix these if we fork the base rule; but that's a lot of code (~650 lines) to add in. +I didn't want to do that just yet without some real-world issues, considering these are pretty rare edge-cases. + +These cases are mishandled because the base rule assumes that each variable has one def, but type-value shadowing +creates a variable with two defs + +--- type-only or value-only references to type/value shadowed variables --- +--- NOTE - TS gets these cases wrong + +type T = 1; +const T = 2; // this T should be unused + +type U = T; // this U should be unused +const U = 3; + +const _V = U; + + +--- partially exported type/value shadowed variables --- +--- NOTE - TS gets these cases wrong + +export interface Foo {} +const Foo = 1; // this Foo should be unused + +interface Bar {} // this Bar should be unused +export const Bar = 1; + +*/ diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index cb6955e8e3d..08d12645d6a 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -16,6 +16,7 @@ function parseOptions(options: string | Config | null): Required { let enums = true; let variables = true; let typedefs = true; + let ignoreTypeReferences = true; if (typeof options === 'string') { functions = options !== 'nofunc'; @@ -25,54 +26,43 @@ function parseOptions(options: string | Config | null): Required { enums = options.enums !== false; variables = options.variables !== false; typedefs = options.typedefs !== false; + ignoreTypeReferences = options.ignoreTypeReferences !== false; } - return { functions, classes, enums, variables, typedefs }; + return { + functions, + classes, + enums, + variables, + typedefs, + ignoreTypeReferences, + }; } /** - * Checks whether or not a given scope is a top level scope. - */ -function isTopLevelScope(scope: TSESLint.Scope.Scope): boolean { - return scope.type === 'module' || scope.type === 'global'; -} - -/** - * Checks whether or not a given variable declaration in an upper scope. + * Checks whether or not a given variable is a function declaration. */ -function isOuterScope( - variable: TSESLint.Scope.Variable, - reference: TSESLint.Scope.Reference, -): boolean { - if (variable.scope.variableScope === reference.from.variableScope) { - // allow the same scope only if it's the top level global/module scope - if (!isTopLevelScope(variable.scope.variableScope)) { - return false; - } - } - - return true; +function isFunction(variable: TSESLint.Scope.Variable): boolean { + return variable.defs[0].type === 'FunctionName'; } /** - * Checks whether or not a given variable is a function declaration. + * Checks whether or not a given variable is a type declaration. */ -function isFunction(variable: TSESLint.Scope.Variable): boolean { - return variable.defs[0].type === 'FunctionName'; +function isTypedef(variable: TSESLint.Scope.Variable): boolean { + return variable.defs[0].type === 'Type'; } /** - * Checks whether or not a given variable is a enum declaration in an upper function scope. + * Checks whether or not a given variable is a enum declaration. */ function isOuterEnum( variable: TSESLint.Scope.Variable, reference: TSESLint.Scope.Reference, ): boolean { - const node = variable.defs[0].node as TSESTree.Node; - return ( - node.type === AST_NODE_TYPES.TSEnumDeclaration && - isOuterScope(variable, reference) + variable.defs[0].type == 'TSEnumName' && + variable.scope.variableScope !== reference.from.variableScope ); } @@ -84,7 +74,8 @@ function isOuterClass( reference: TSESLint.Scope.Reference, ): boolean { return ( - variable.defs[0].type === 'ClassName' && isOuterScope(variable, reference) + variable.defs[0].type === 'ClassName' && + variable.scope.variableScope !== reference.from.variableScope ); } @@ -96,7 +87,8 @@ function isOuterVariable( reference: TSESLint.Scope.Reference, ): boolean { return ( - variable.defs[0].type === 'Variable' && isOuterScope(variable, reference) + variable.defs[0].type === 'Variable' && + variable.scope.variableScope !== reference.from.variableScope ); } @@ -165,6 +157,7 @@ interface Config { enums?: boolean; variables?: boolean; typedefs?: boolean; + ignoreTypeReferences?: boolean; } type Options = ['nofunc' | Config]; type MessageIds = 'noUseBeforeDefine'; @@ -196,6 +189,7 @@ export default util.createRule({ enums: { type: 'boolean' }, variables: { type: 'boolean' }, typedefs: { type: 'boolean' }, + ignoreTypeReferences: { type: 'boolean' }, }, additionalProperties: false, }, @@ -210,6 +204,7 @@ export default util.createRule({ enums: true, variables: true, typedefs: true, + ignoreTypeReferences: true, }, ], create(context, optionsWithDefault) { @@ -224,17 +219,23 @@ export default util.createRule({ variable: TSESLint.Scope.Variable, reference: TSESLint.Scope.Reference, ): boolean { + if (reference.isTypeReference && options.ignoreTypeReferences) { + return false; + } if (isFunction(variable)) { - return !!options.functions; + return options.functions; } if (isOuterClass(variable, reference)) { - return !!options.classes; + return options.classes; } if (isOuterVariable(variable, reference)) { - return !!options.variables; + return options.variables; } if (isOuterEnum(variable, reference)) { - return !!options.enums; + return options.enums; + } + if (isTypedef(variable)) { + return options.typedefs; } return true; diff --git a/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts b/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts index e67ec96aed2..6d19021fa56 100644 --- a/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts @@ -1,5 +1,5 @@ import rule from 'eslint/lib/rules/arrow-parens'; -import { RuleTester } from '../RuleTester'; +import { RuleTester, noFormat } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -8,7 +8,7 @@ const ruleTester = new RuleTester({ ruleTester.run('arrow-parens', rule, { valid: [ // https://github.com/typescript-eslint/typescript-eslint/issues/14 - 'const foo = (t) => {};', + noFormat`const foo = (t) => {};`, 'const foo = (t) => {};', 'const foo = (t: T) => {};', 'const foo = ((t: T) => {});', @@ -16,7 +16,7 @@ ruleTester.run('arrow-parens', rule, { ` const foo = (bar: any): void => { // Do nothing -} +}; `, { code: 'const foo = t => {};', diff --git a/packages/eslint-plugin/tests/eslint-rules/no-dupe-args.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-dupe-args.test.ts index f9c0817772a..0dc4807edb1 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-dupe-args.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-dupe-args.test.ts @@ -15,7 +15,7 @@ ruleTester.run('no-dupe-args', rule, { // https://github.com/eslint/typescript-eslint-parser/issues/535 ` function foo({ bar }: { bar: string }) { - console.log(bar); + console.log(bar); } `, ], diff --git a/packages/eslint-plugin/tests/eslint-rules/no-implicit-globals.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-implicit-globals.test.ts index 57a1c42e03e..2fc971bdef6 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-implicit-globals.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-implicit-globals.test.ts @@ -14,7 +14,7 @@ ruleTester.run('no-implicit-globals', rule, { // https://github.com/typescript-eslint/typescript-eslint/issues/23 ` function foo() { - return "bar"; + return 'bar'; } module.exports = foo; 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 21e6369d1b2..7a457a61784 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 @@ -16,28 +16,28 @@ ruleTester.run('no-restricted-globals', rule, { { code: ` export default class Test { - private status: string; - getStatus() { - return this.status; - } + private status: string; + getStatus() { + return this.status; + } } `, options: ['status'], }, { code: ` -type Handler = (event: string) => any +type Handler = (event: string) => any; `, options: ['event'], }, { code: ` - const a = foo?.bar?.name + const a = foo?.bar?.name; `, }, { code: ` - const a = foo?.bar?.name ?? "foobar" + const a = foo?.bar?.name ?? 'foobar'; `, }, { @@ -58,9 +58,8 @@ function onClick() { console.log(event); } -fdescribe("foo", function() { -}); - `, +fdescribe('foo', function () {}); + `, options: ['event'], errors: [ { @@ -73,8 +72,8 @@ fdescribe("foo", function() { }, { code: ` -confirm("TEST"); - `, +confirm('TEST'); + `, options: ['confirm'], errors: [ { @@ -87,8 +86,8 @@ confirm("TEST"); }, { code: ` -var a = confirm("TEST")?.a; - `, +var a = confirm('TEST')?.a; + `, options: ['confirm'], errors: [ { diff --git a/packages/eslint-plugin/tests/eslint-rules/no-shadow.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-shadow.test.ts deleted file mode 100644 index a1b72733b2b..00000000000 --- a/packages/eslint-plugin/tests/eslint-rules/no-shadow.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import rule from 'eslint/lib/rules/no-shadow'; -import { RuleTester } from '../RuleTester'; - -const ruleTester = new RuleTester({ - parserOptions: { - ecmaVersion: 6, - sourceType: 'module', - ecmaFeatures: {}, - }, - parser: '@typescript-eslint/parser', -}); - -ruleTester.run('no-shadow', rule, { - valid: [ - // https://github.com/eslint/typescript-eslint-parser/issues/459 - ` -type foo = any; -function bar(foo: any) {} - `, - // https://github.com/typescript-eslint/typescript-eslint/issues/20 - ` -export abstract class Foo {} -export class FooBar extends Foo {} - `, - // https://github.com/typescript-eslint/typescript-eslint/issues/207 - ` -function test(this: Foo) { - function test2(this: Bar) {} -} - `, - ], - 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 38d58b482fd..fea74c8aae3 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -31,26 +31,35 @@ export default Beemo; // https://github.com/eslint/typescript-eslint-parser/issues/471 ` class X { - field = {} + field = {}; } `, // https://github.com/eslint/typescript-eslint-parser/issues/466 ` -/*globals document, selector */ -const links = document.querySelectorAll( selector ) as NodeListOf +/*globals document, selector, NodeListOf, HTMLElement */ +const links = document.querySelectorAll(selector) as NodeListOf; `, + { + code: ` +/*globals document, selector */ +const links = document.querySelectorAll(selector) as NodeListOf; + `, + parserOptions: { + lib: ['dom'], + }, + }, // https://github.com/eslint/typescript-eslint-parser/issues/437 ` interface Runnable { - run (): Result - toString (): string + run(): void; + toString(): string; } `, // https://github.com/eslint/typescript-eslint-parser/issues/416 ` export type SomeThing = { - id: string; -} + id: string; +}; `, // https://github.com/typescript-eslint/typescript-eslint/issues/20 ` @@ -59,9 +68,26 @@ export class FooBar extends Foo {} `, // https://github.com/typescript-eslint/typescript-eslint/issues/18 ` -function eachr(subject: Map): typeof subject; -function eachr(subject: Object | Array): typeof subject { - return subject +interface IteratorCallback { + (this: Subject, value: Value, key: Key, subject: Subject): void | false; +} +function eachr( + subject: Array, + callback: IteratorCallback, +): typeof subject; +function eachr( + subject: Map, + callback: IteratorCallback, +): typeof subject; +function eachr( + subject: Object, + callback: IteratorCallback, +): Object; +function eachr( + subject: Object | Array | Map, + callback: IteratorCallback, +): typeof subject { + return subject; } `, // https://github.com/typescript-eslint/typescript-eslint/issues/18 @@ -74,11 +100,11 @@ function eachr(subject: Map): typeof subject; `, ` var a = { b: { c: 3 } }; - var d = a?.["b"]?.c; + var d = a?.['b']?.c; `, ` var a = { b: 3 }; - var c = { }; + var c = {}; var d = (a || c)?.b; `, ` diff --git a/packages/eslint-plugin/tests/eslint-rules/strict.test.ts b/packages/eslint-plugin/tests/eslint-rules/strict.test.ts index 96745d2541b..51d27c9bde9 100644 --- a/packages/eslint-plugin/tests/eslint-rules/strict.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/strict.test.ts @@ -16,9 +16,9 @@ ruleTester.run('strict', rule, { window.whatevs = { myFunc() { console.log('yep'); - } + }, }; -`, + `, ], invalid: [ { @@ -27,9 +27,9 @@ window.whatevs = { window.whatevs = { myFunc() { console.log('yep'); - } + }, }; -`, + `, parserOptions: { sourceType: 'script', }, diff --git a/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts similarity index 56% rename from packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts rename to packages/eslint-plugin/tests/rules/no-redeclare.test.ts index 45ca71b4a79..5a91d1c9822 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts @@ -1,9 +1,9 @@ -import rule from 'eslint/lib/rules/no-redeclare'; import { AST_NODE_TYPES, AST_TOKEN_TYPES, } from '@typescript-eslint/experimental-utils'; import { RuleTester } from '../RuleTester'; +import rule from '../../src/rules/no-redeclare'; const ruleTester = new RuleTester({ parserOptions: { @@ -14,10 +14,24 @@ const ruleTester = new RuleTester({ ruleTester.run('no-redeclare', rule, { valid: [ - 'var a = 3; var b = function() { var a = 10; };', - 'var a = 3; a = 10;', + ` +var a = 3; +var b = function () { + var a = 10; +}; + `, + ` +var a = 3; +a = 10; + `, { - code: 'if (true) {\n let b = 2;\n} else { \nlet b = 3;\n}', + code: ` +if (true) { + let b = 2; +} else { + let b = 3; +} + `, parserOptions: { ecmaVersion: 6, }, @@ -52,19 +66,14 @@ ruleTester.run('no-redeclare', rule, { env: { browser: true }, }, { - code: 'var self = 1', + code: 'var self = 1;', options: [{ builtinGlobals: true }], env: { browser: false }, }, - // https://github.com/eslint/typescript-eslint-parser/issues/443 - ` -const Foo = 1; -type Foo = 1; - `, // https://github.com/eslint/typescript-eslint-parser/issues/535 ` function foo({ bar }: { bar: string }) { - console.log(bar); + console.log(bar); } `, ` @@ -80,13 +89,57 @@ interface ParseAndGenerateServicesResult { ` function A() {} interface B {} -type C = Array +type C = Array; class D {} `, + ` +function a(): string; +function a(): number; +function a() {} + `, + { + code: ` +interface A {} +interface A {} + `, + options: [{ ignoreDeclarationMerge: true }], + }, + { + code: ` +interface A {} +class A {} + `, + options: [{ ignoreDeclarationMerge: true }], + }, + { + code: ` +class A {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: true }], + }, + { + code: ` +interface A {} +class A {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: true }], + }, + { + code: ` +function A() {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: true }], + }, ], invalid: [ { - code: 'var a = 3; var a = 10;', + code: ` +var a = 3; +var a = 10; + `, parserOptions: { ecmaVersion: 6 }, errors: [ { @@ -99,7 +152,14 @@ class D {} ], }, { - code: 'switch(foo) { case a: var b = 3;\ncase b: var b = 4}', + code: ` +switch (foo) { + case a: + var b = 3; + case b: + var b = 4; +} + `, errors: [ { messageId: 'redeclared', @@ -111,7 +171,10 @@ class D {} ], }, { - code: 'var a = 3; var a = 10;', + code: ` +var a = 3; +var a = 10; + `, errors: [ { messageId: 'redeclared', @@ -123,7 +186,10 @@ class D {} ], }, { - code: 'var a = {}; var a = [];', + code: ` +var a = {}; +var a = []; + `, errors: [ { messageId: 'redeclared', @@ -135,7 +201,10 @@ class D {} ], }, { - code: 'var a; function a() {}', + code: ` +var a; +function a() {} + `, errors: [ { messageId: 'redeclared', @@ -147,7 +216,10 @@ class D {} ], }, { - code: 'function a() {} function a() {}', + code: ` +function a() {} +function a() {} + `, errors: [ { messageId: 'redeclared', @@ -159,7 +231,10 @@ class D {} ], }, { - code: 'var a = function() { }; var a = function() { }', + code: ` +var a = function () {}; +var a = function () {}; + `, errors: [ { messageId: 'redeclared', @@ -171,7 +246,10 @@ class D {} ], }, { - code: 'var a = function() { }; var a = new Date();', + code: ` +var a = function () {}; +var a = new Date(); + `, errors: [ { messageId: 'redeclared', @@ -183,7 +261,11 @@ class D {} ], }, { - code: 'var a = 3; var a = 10; var a = 15;', + code: ` +var a = 3; +var a = 10; +var a = 15; + `, errors: [ { messageId: 'redeclared', @@ -202,7 +284,10 @@ class D {} ], }, { - code: 'var a; var a;', + code: ` +var a; +var a; + `, parserOptions: { sourceType: 'module' }, errors: [ { @@ -215,7 +300,10 @@ class D {} ], }, { - code: 'export var a; var a;', + code: ` +export var a; +var a; + `, parserOptions: { sourceType: 'module' }, errors: [ { @@ -255,7 +343,10 @@ class D {} env: { browser: true }, }, { - code: 'var a; var {a = 0, b: Object = 0} = {};', + code: ` +var a; +var { a = 0, b: Object = 0 } = {}; + `, options: [{ builtinGlobals: true }], parserOptions: { ecmaVersion: 6 }, errors: [ @@ -276,7 +367,10 @@ class D {} ], }, { - code: 'var a; var {a = 0, b: Object = 0} = {};', + code: ` +var a; +var { a = 0, b: Object = 0 } = {}; + `, options: [{ builtinGlobals: true }], parserOptions: { ecmaVersion: 6, sourceType: 'module' }, errors: [ @@ -290,7 +384,10 @@ class D {} ], }, { - code: 'var a; var {a = 0, b: Object = 0} = {};', + code: ` +var a; +var { a = 0, b: Object = 0 } = {}; + `, options: [{ builtinGlobals: true }], parserOptions: { ecmaVersion: 6, ecmaFeatures: { globalReturn: true } }, errors: [ @@ -304,7 +401,10 @@ class D {} ], }, { - code: 'var a; var {a = 0, b: Object = 0} = {};', + code: ` +var a; +var { a = 0, b: Object = 0 } = {}; + `, options: [{ builtinGlobals: false }], parserOptions: { ecmaVersion: 6 }, errors: [ @@ -328,7 +428,202 @@ class D {} data: { id: 'b', }, - type: AST_TOKEN_TYPES.Block, + type: AST_TOKEN_TYPES.Identifier, + }, + ], + }, + + { + code: ` +type T = 1; +type T = 2; + `, + errors: [ + { + messageId: 'redeclared', + data: { + id: 'T', + }, + line: 3, + }, + ], + }, + { + code: ` +type NodeListOf = 1; + `, + options: [{ builtinGlobals: true }], + parserOptions: { + lib: ['dom'], + }, + errors: [ + { + messageId: 'redeclaredAsBuiltin', + data: { + id: 'NodeListOf', + }, + }, + ], + }, + { + code: ` +interface A {} +interface A {} + `, + options: [{ ignoreDeclarationMerge: false }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + ], + }, + { + code: ` +interface A {} +class A {} + `, + options: [{ ignoreDeclarationMerge: false }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + ], + }, + { + code: ` +class A {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: false }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + ], + }, + { + code: ` +interface A {} +class A {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: false }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 4, + }, + ], + }, + { + code: ` +class A {} +class A {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: true }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + ], + }, + { + code: ` +function A() {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: false }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + ], + }, + { + code: ` +function A() {} +function A() {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: true }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + ], + }, + { + code: ` +function A() {} +class A {} + `, + options: [{ ignoreDeclarationMerge: false }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + ], + }, + { + code: ` +function A() {} +class A {} +namespace A {} + `, + options: [{ ignoreDeclarationMerge: false }], + errors: [ + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 3, + }, + { + messageId: 'redeclared', + data: { + id: 'A', + }, + line: 4, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow.test.ts new file mode 100644 index 00000000000..1bf16fed28c --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-shadow.test.ts @@ -0,0 +1,1223 @@ +import rule from '../../src/rules/no-shadow'; +import { RuleTester } from '../RuleTester'; +import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; + +const ruleTester = new RuleTester({ + parserOptions: { + sourceType: 'module', + }, + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-shadow TS tests', rule, { + valid: [ + ` +function foo() { + var Object = 0; +} + `, + // this params + ` +function test(this: Foo) { + function test2(this: Bar) {} +} + `, + // declaration merging + ` +class Foo { + prop = 1; +} +namespace Foo { + export const v = 2; +} + `, + ` +function Foo() {} +namespace Foo { + export const v = 2; +} + `, + ` +class Foo { + prop = 1; +} +interface Foo { + prop2: string; +} + `, + // type value shadowing + ` +const x = 1; +type x = string; + `, + ` +const x = 1; +{ + type x = string; +} + `, + ], + invalid: [ + { + code: ` +type T = 1; +{ + type T = 2; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'T', + }, + line: 4, + }, + ], + }, + { + code: ` +function foo() { + return function () {}; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'T', + }, + line: 3, + }, + ], + }, + { + code: ` +const x = 1; +{ + type x = string; +} + `, + options: [{ ignoreTypeValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'x', + }, + line: 4, + }, + ], + }, + ], +}); + +ruleTester.run('no-shadow base eslint tests', rule, { + valid: [ + ` +var a = 3; +function b(x) { + a++; + return x + a; +} +setTimeout(function () { + b(a); +}, 0); + `, + ` +(function () { + var doSomething = function doSomething() {}; + doSomething(); +})(); + `, + ` +var arguments; +function bar() {} + `, + { + code: ` +var a = 3; +var b = x => { + a++; + return x + a; +}; +setTimeout(() => { + b(a); +}, 0); + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'class A {}', + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +class A { + constructor() { + var a; + } +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +(function () { + var A = class A {}; +})(); + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + var a; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, // this case reports `no-redeclare`, not shadowing. + { + code: ` +{ + let a; +} +let a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + let a; +} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + let a; +} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +const a = 1; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +let a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +let a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +let a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +var a; + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +function a() {} + `, + options: [{ hoist: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + let a; +} +let a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + let a; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +const a = 1; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +{ + const a = 0; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +let a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + let a; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +let a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo() { + var a; +} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +let a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +function foo(a) {} +var a; + `, + parserOptions: { ecmaVersion: 6 }, + }, + ` +function foo() { + var Object = 0; +} + `, + { + code: ` +function foo() { + var top = 0; +} + `, + env: { browser: true }, + }, + { + code: ` +function foo(cb) { + (function (cb) { + cb(42); + })(cb); +} + `, + options: [{ allow: ['cb'] }], + }, + ], + invalid: [ + { + code: ` +function a(x) { + var b = function c() { + var x = 'foo'; + }; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'x' }, + type: AST_NODE_TYPES.Identifier, + line: 4, + column: 9, + }, + ], + }, + { + code: ` +var a = x => { + var b = () => { + var x = 'foo'; + }; +}; + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'x' }, + type: AST_NODE_TYPES.Identifier, + line: 4, + column: 9, + }, + ], + }, + { + code: ` +function a(x) { + var b = function () { + var x = 'foo'; + }; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'x' }, + type: AST_NODE_TYPES.Identifier, + line: 4, + column: 9, + }, + ], + }, + { + code: ` +var x = 1; +function a(x) { + return ++x; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'x' }, + type: AST_NODE_TYPES.Identifier, + line: 3, + column: 12, + }, + ], + }, + { + code: ` +var a = 3; +function b() { + var a = 10; +} + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var a = 3; +function b() { + var a = 10; +} +setTimeout(function () { + b(); +}, 0); + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var a = 3; +function b() { + var a = 10; + var b = 0; +} +setTimeout(function () { + b(); +}, 0); + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + { + messageId: 'noShadow', + data: { name: 'b' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +var x = 1; +{ + let x = 2; +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'x' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +let x = 1; +{ + const x = 2; +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'x' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + let a; +} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + const a = 0; +} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + let a; +} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var a; +} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(a) {} +function a() {} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + let a; +} +let a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + let a; +} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + let a; +} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + const a = 0; +} +const a = 1; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + const a = 0; +} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +{ + const a = 0; +} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + let a; +} +let a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + let a; +} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + let a; +} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var a; +} +let a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var a; +} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var a; +} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(a) {} +let a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(a) {} +var a; + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(a) {} +function a() {} + `, + options: [{ hoist: 'all' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + function a() {} +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + class a {} +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + (function a() {}); +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + (class a {}); +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function (a) {}; +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function () { + function a() {} + }; +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function () { + class a {} + }; +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function () { + (function a() {}); + }; +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = function () { + (class a {}); + }; +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function () { + var a = class { + constructor() { + class a {} + } + }; +})(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +class A { + constructor() { + var A; + } +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'A' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +(function a() { + function a() { + function a() {} + } +})(); + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + line: 3, + column: 12, + }, + { + messageId: 'noShadow', + data: { name: 'a' }, + type: AST_NODE_TYPES.Identifier, + line: 4, + column: 14, + }, + ], + }, + { + code: ` +function foo() { + var Object = 0; +} + `, + options: [{ builtinGlobals: true }], + errors: [ + { + messageId: 'noShadow', + data: { name: 'Object' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo() { + var top = 0; +} + `, + options: [{ builtinGlobals: true }], + env: { browser: true }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'top' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: 'var Object = 0;', + options: [{ builtinGlobals: true }], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'Object' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: 'var top = 0;', + options: [{ builtinGlobals: true }], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + env: { browser: true }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'top' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: 'var Object = 0;', + options: [{ builtinGlobals: true }], + parserOptions: { ecmaFeatures: { globalReturn: true } }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'Object' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: 'var top = 0;', + options: [{ builtinGlobals: true }], + parserOptions: { ecmaFeatures: { globalReturn: true } }, + env: { browser: true }, + errors: [ + { + messageId: 'noShadow', + data: { name: 'top' }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, + { + code: ` +function foo(cb) { + (function (cb) { + cb(42); + })(cb); +} + `, + errors: [ + { + messageId: 'noShadow', + data: { name: 'cb' }, + type: AST_NODE_TYPES.Identifier, + line: 3, + column: 14, + }, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts index b197a96afe2..f5671dd5d6b 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts @@ -14,6 +14,16 @@ const ruleTester = new RuleTester({ ruleTester.run('no-unnecessary-type-assertion', rule, { valid: [ + ` +import { TSESTree } from '@typescript-eslint/experimental-utils'; +declare const member: TSESTree.TSEnumMember; +if ( + member.id.type === AST_NODE_TYPES.Literal && + typeof member.id.value === 'string' +) { + const name = member.id as TSESTree.StringLiteral; +} + `, 'const foo = 3 as number;', 'const foo = 3;', 'const foo = <3>3;', diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index 73ad95d1f4d..588b4141529 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -122,22 +122,22 @@ console.log(a); `, ` import { Foo } from 'foo'; -function bar() {} +function bar(): T {} bar(); `, ` import { Foo } from 'foo'; -const bar = function () {}; +const bar = function (): T {}; bar(); `, ` import { Foo } from 'foo'; -const bar = () => {}; +const bar = (): T => {}; bar(); `, ` import { Foo } from 'foo'; -(() => {})(); +((): T => {})(); `, ` import { Nullable } from 'nullable'; @@ -265,14 +265,14 @@ new A(); ` import { Nullable } from 'nullable'; import { Another } from 'some'; -interface A { +export interface A { do(a: Nullable); } `, ` import { Nullable } from 'nullable'; import { Another } from 'some'; -interface A { +export interface A { other: Nullable; } `, @@ -293,7 +293,6 @@ foo(); ` import { Nullable } from 'nullable'; import { SomeOther } from 'some'; -import { Another } from 'some'; class A extends Nullable { other: Nullable; } @@ -314,7 +313,7 @@ new A(); import { Nullable } from 'nullable'; import { SomeOther } from 'some'; import { Another } from 'some'; -interface A extends Nullable { +export interface A extends Nullable { other: Nullable; } `, @@ -322,49 +321,61 @@ interface A extends Nullable { import { Nullable } from 'nullable'; import { SomeOther } from 'some'; import { Another } from 'some'; -interface A extends Nullable { +export interface A extends Nullable { do(a: Nullable); } `, ` import { Foo } from './types'; -class Bar {} +class Bar { + prop: T; +} new Bar(); `, ` import { Foo, Bar } from './types'; -class Baz {} +class Baz { + prop: T; +} new Baz(); `, ` import { Foo } from './types'; -class Bar {} +class Bar { + prop: T; +} new Bar(); `, ` import { Foo } from './types'; -class Foo {} +class Foo { + prop: T; +} new Foo(); `, ` import { Foo } from './types'; -class Foo {} +class Foo { + prop: T; +} new Foo(); `, ` import { Foo } from './types'; -class Foo {} +class Foo { + prop: T; +} new Foo(); `, @@ -388,7 +399,7 @@ new A(); ` import { Nullable } from 'nullable'; import { SomeOther } from 'other'; -function foo() {} +function foo(): T {} foo(); `, ` @@ -473,7 +484,9 @@ export function authenticated(cb: (user: User | null) => void): void { // https://github.com/bradzacher/eslint-plugin-typescript/issues/33 ` import { Foo } from './types'; -export class Bar {} +export class Bar { + prop: T; +} `, ` import webpack from 'webpack'; @@ -487,7 +500,9 @@ export function foo(options: ExecaOptions): execa { `, ` import { Foo, Bar } from './types'; -export class Baz {} +export class Baz { + prop: F; +} `, ` // warning 'B' is defined but never used @@ -504,7 +519,7 @@ enum FormFieldIds { PHONE = 'phone', EMAIL = 'email', } -interface IFoo { +export interface IFoo { fieldName: FormFieldIds; } `, @@ -513,7 +528,7 @@ enum FormFieldIds { PHONE = 'phone', EMAIL = 'email', } -interface IFoo { +export interface IFoo { fieldName: FormFieldIds.EMAIL; } `, @@ -529,13 +544,12 @@ const server: fastify.FastifyInstance< server.get('/ping'); `, // https://github.com/typescript-eslint/typescript-eslint/issues/61 - 'declare function foo();', - // https://github.com/typescript-eslint/typescript-eslint/issues/61 ` declare namespace Foo { function bar(line: string, index: number | null, tabSize: number): number; var baz: string; } +console.log(Foo); `, // https://github.com/typescript-eslint/typescript-eslint/issues/61 ` @@ -614,6 +628,105 @@ export default class Foo { ) { prop(); } +} + `, + ` +declare function foo(a: number): void; + `, + ` +export function foo(): void; +export function foo(): void; +export function foo(): void {} + `, + ` +export function foo(a: number): number; +export function foo(a: string): string; +export function foo(a: number | string): number | string { + return a; +} + `, + ` +export function foo(a: number): T; +export function foo(a: string): T; +export function foo(a: number | string): T { + return a; +} + `, + ` +export type T = { + new (): T; + new (arg: number): T; + new (arg: number): T; +}; + `, + ` +export type T = new () => T; +export type T = new (arg: number) => T; +export type T = new (arg: number) => T; + `, + ` +enum Foo { + a, +} +export type T = { + [Foo.a]: 1; +}; + `, + ` +namespace Foo { + export const Foo = 1; +} + +export { Foo }; + `, + ` +export namespace Foo { + export const item: Foo = 1; +} + `, + // exported self-referencing types + ` +export interface Foo { + bar: string; + baz: Foo['bar']; +} + `, + ` +export type Bar = Array; + `, + // declaration merging + ` +function Foo() {} + +namespace Foo { + export const x = 1; +} + +export { Foo }; + `, + ` +class Foo {} + +namespace Foo { + export const x = 1; +} + +export { Foo }; + `, + ` +namespace Foo {} + +const Foo = 1; + +export { Foo }; + `, + ` +type Foo = { + error: Error | null; +}; + +export function foo() { + return new Promise(); } `, ], @@ -640,7 +753,7 @@ export class Foo {} { code: ` import { Foo, Bar } from 'foo'; -function baz() {} +function baz(): Foo {} baz(); `, errors: [ @@ -772,7 +885,7 @@ new A(); code: ` import { Nullable } from 'nullable'; import { Another } from 'some'; -interface A { +export interface A { do(a: Nullable); } `, @@ -793,7 +906,7 @@ interface A { code: ` import { Nullable } from 'nullable'; import { Another } from 'some'; -interface A { +export interface A { other: Nullable; } `, @@ -994,5 +1107,149 @@ export class Bar implements baz().test {} }, ], }, + { + code: ` +namespace Foo {} + `, + errors: [ + { + messageId: 'unusedVar', + data: { + varName: 'Foo', + action: 'defined', + additional: '', + }, + line: 2, + column: 11, + }, + ], + }, + { + code: ` +namespace Foo { + export const Foo = 1; +} + `, + errors: [ + { + messageId: 'unusedVar', + data: { + varName: 'Foo', + action: 'defined', + additional: '', + }, + line: 2, + column: 11, + }, + ], + }, + { + code: ` +namespace Foo { + const Foo = 1; + console.log(Foo); +} + `, + errors: [ + { + messageId: 'unusedVar', + data: { + varName: 'Foo', + action: 'defined', + additional: '', + }, + line: 2, + column: 11, + }, + ], + }, + { + code: ` +namespace Foo { + export const Bar = 1; + console.log(Foo.Bar); +} + `, + errors: [ + { + messageId: 'unusedVar', + data: { + varName: 'Foo', + action: 'defined', + additional: '', + }, + line: 2, + column: 11, + }, + ], + }, + { + code: ` +namespace Foo { + namespace Foo { + export const Bar = 1; + console.log(Foo.Bar); + } +} + `, + errors: [ + { + messageId: 'unusedVar', + data: { + varName: 'Foo', + action: 'defined', + additional: '', + }, + line: 2, + column: 11, + }, + { + messageId: 'unusedVar', + data: { + varName: 'Foo', + action: 'defined', + additional: '', + }, + line: 3, + column: 13, + }, + ], + }, + // self-referencing types + { + code: ` +interface Foo { + bar: string; + baz: Foo['bar']; +} + `, + errors: [ + { + messageId: 'unusedVar', + line: 2, + data: { + varName: 'Foo', + action: 'defined', + additional: '', + }, + }, + ], + }, + { + code: ` +type Foo = Array; + `, + errors: [ + { + messageId: 'unusedVar', + line: 2, + data: { + varName: 'Foo', + action: 'defined', + additional: '', + }, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts index aa09db0f29f..dd8e2e7271e 100644 --- a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts +++ b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts @@ -220,25 +220,6 @@ type Foo = string | number; options: [{ typedefs: false }], }, - // test for https://github.com/bradzacher/eslint-plugin-typescript/issues/142 - { - code: ` -var alias = Test; - -class Test {} - `, - parserOptions, - options: [{ classes: false }], - }, - { - code: ` -var alias = Test; - -export class Test {} - `, - parserOptions: { ecmaVersion: 6, sourceType: 'module' }, - options: [{ classes: false }], - }, // https://github.com/bradzacher/eslint-plugin-typescript/issues/141 { code: ` @@ -861,6 +842,8 @@ enum Foo { errors: [ { messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + line: 4, }, ], }, @@ -878,6 +861,8 @@ enum Foo { errors: [ { messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + line: 3, }, ], }, @@ -893,6 +878,8 @@ enum Foo { errors: [ { messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + line: 2, }, ], }, diff --git a/packages/eslint-plugin/tsconfig.build.json b/packages/eslint-plugin/tsconfig.build.json index 86f3842dae3..52fd3f6be6d 100644 --- a/packages/eslint-plugin/tsconfig.build.json +++ b/packages/eslint-plugin/tsconfig.build.json @@ -12,6 +12,7 @@ "references": [ { "path": "../experimental-utils/tsconfig.build.json" }, { "path": "../parser/tsconfig.build.json" }, + { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../typescript-estree/tsconfig.build.json" } ] } diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index add5af1c1bb..fa9fc6170a6 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -353,8 +353,8 @@ declare module 'eslint/lib/rules/no-shadow' { [ { builtinGlobals?: boolean; - hoist: 'all' | 'functions' | 'never'; - allow: string[]; + hoist?: 'all' | 'functions' | 'never'; + allow?: string[]; }, ], { @@ -386,7 +386,7 @@ declare module 'eslint/lib/rules/no-unused-vars' { const rule: TSESLint.RuleModule< 'unusedVar', - ( + [ | 'all' | 'local' | { @@ -397,8 +397,8 @@ declare module 'eslint/lib/rules/no-unused-vars' { argsIgnorePattern?: string; caughtErrors?: 'all' | 'none'; caughtErrorsIgnorePattern?: string; - } - )[], + }, + ], { ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; } diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 594e623554a..def4536f1f3 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -40,6 +40,7 @@ }, "dependencies": { "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "3.10.1", "@typescript-eslint/types": "3.10.1", "@typescript-eslint/typescript-estree": "3.10.1", "eslint-scope": "^5.0.0", diff --git a/packages/experimental-utils/src/ts-eslint/Scope.ts b/packages/experimental-utils/src/ts-eslint/Scope.ts index 9dcae37f060..2a7f707a429 100644 --- a/packages/experimental-utils/src/ts-eslint/Scope.ts +++ b/packages/experimental-utils/src/ts-eslint/Scope.ts @@ -1,114 +1,54 @@ /* eslint-disable @typescript-eslint/no-namespace */ -import { TSESTree } from '../ts-estree'; +import * as scopeManager from '@typescript-eslint/scope-manager'; +import { TSESTree } from '@typescript-eslint/types'; namespace Scope { - export interface ScopeManager { - scopes: Scope[]; - globalScope: Scope | null; - - acquire(node: TSESTree.Node, inner?: boolean): Scope | null; - - getDeclaredVariables(node: TSESTree.Node): Variable[]; - } - - export interface Reference { - identifier: TSESTree.Identifier; - from: Scope; - resolved: Variable | null; - writeExpr: TSESTree.Node | null; - init: boolean; - - isWrite(): boolean; - - isRead(): boolean; - - isWriteOnly(): boolean; - - isReadOnly(): boolean; - - isReadWrite(): boolean; - } - - export interface Variable { - name: string; - identifiers: TSESTree.Identifier[]; - references: Reference[]; - defs: Definition[]; - scope: Scope; - eslintUsed?: boolean; + // ESLint defines global variables using the eslint-scope Variable class + // So a variable in the scope may be either of these + declare class ESLintScopeVariable { + public readonly defs: Definition[]; + public readonly identifiers: TSESTree.Identifier[]; + public readonly name: string; + public readonly references: Reference[]; + public readonly scope: Scope; + + /** + * Written to by ESLint. + * If this key exists, this variable is a global variable added by ESLint. + * If this is `true`, this variable can be assigned arbitrary values. + * If this is `false`, this variable is readonly. + */ + public writeable?: boolean; // note that this isn't a typo - ESlint uses this spelling here + + /** + * Written to by ESLint. + * This property is undefined if there are no globals directive comments. + * The array of globals directive comments which defined this global variable in the source code file. + */ + public eslintExplicitGlobal?: boolean; + + /** + * Written to by ESLint. + * The configured value in config files. This can be different from `variable.writeable` if there are globals directive comments. + */ + public eslintImplicitGlobalSetting?: 'readonly' | 'writable'; + + /** + * Written to by ESLint. + * If this key exists, it is a global variable added by ESLint. + * If `true`, this global variable was defined by a globals directive comment in the source code file. + */ + public eslintExplicitGlobalComments?: TSESTree.Comment[]; } - export interface Scope { - type: - | 'block' - | 'catch' - | 'class' - | 'for' - | 'function' - | 'function-expression-name' - | 'global' - | 'module' - | 'switch' - | 'with' - | 'TDZ'; - isStrict: boolean; - upper: Scope | null; - childScopes: Scope[]; - variableScope: Scope; - block: TSESTree.Node; - variables: Variable[]; - set: Map; - references: Reference[]; - through: Reference[]; - functionExpressionScope: boolean; - } - - export type DefinitionType = - | { - // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum - type: 'CatchClause'; - node: TSESTree.CatchClause; - parent: null; - } - | { - type: 'ClassName'; - node: TSESTree.ClassDeclaration | TSESTree.ClassExpression; - parent: null; - } - | { - type: 'FunctionName'; - node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression; - parent: null; - } - | { - type: 'ImplicitGlobalVariable'; - node: TSESTree.Program; - parent: null; - } - | { - type: 'ImportBinding'; - node: - | TSESTree.ImportSpecifier - | TSESTree.ImportDefaultSpecifier - | TSESTree.ImportNamespaceSpecifier; - parent: TSESTree.ImportDeclaration; - } - | { - type: 'Parameter'; - node: - | TSESTree.FunctionDeclaration - | TSESTree.FunctionExpression - | TSESTree.ArrowFunctionExpression; - parent: null; - } - | { - type: 'Variable'; - node: TSESTree.VariableDeclarator; - parent: TSESTree.VariableDeclaration; - }; - - export type Definition = DefinitionType & { name: TSESTree.Identifier }; + export type ScopeManager = scopeManager.ScopeManager; + export type Reference = scopeManager.Reference; + export type Variable = scopeManager.Variable | ESLintScopeVariable; + export type Scope = scopeManager.Scope; + // TODO - in the next major, clean this up with a breaking change + export type DefinitionType = scopeManager.Definition; + export type Definition = scopeManager.Definition; } export { Scope }; diff --git a/packages/experimental-utils/tsconfig.build.json b/packages/experimental-utils/tsconfig.build.json index cef65159074..e5c1077c5e5 100644 --- a/packages/experimental-utils/tsconfig.build.json +++ b/packages/experimental-utils/tsconfig.build.json @@ -8,6 +8,7 @@ }, "include": ["src", "typings"], "references": [ + { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" }, { "path": "../typescript-estree/tsconfig.build.json" } ] diff --git a/packages/parser/README.md b/packages/parser/README.md index 02bb09e561a..512d6529ec7 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -51,7 +51,11 @@ The following additional configuration options are available by specifying them interface ParserOptions { ecmaFeatures?: { jsx?: boolean; + globalReturn?: boolean; }; + ecmaVersion?: number; + lib?: string[]; + project?: string | string[]; projectFolderIgnoreList?: (string | RegExp)[]; tsconfigRootDir?: string; @@ -77,6 +81,32 @@ Enable parsing JSX when `true`. More details can be found [here](https://www.typ - `.ts` files are parsed as if this is false. - "unknown" extensions (`.md`, `.vue`) **are parsed as if this is false**. +### `parserOptions.ecmaFeatures.globalReturn` + +Default `false`. + +This options allows you to tell the parser if you want to allow global `return` statements in your codebase. + +### `parserOptions.ecmaVersion` + +Default `2018`. + +Accepts any valid ECMAScript version number: + +- A version: es3, es5, es6, es7, es8, es9, es10, es11, ..., or +- A year: es2015, es2016, es2017, es2018, es2019, es2020, ... + +Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default + +### `parserOptions.lib` + +Default `['es2018']` + +For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib). + +Specifies the TypeScript `lib`s that are available. This is used by the scope analyser to ensure there are global variables declared for the types exposed by TypeScript. +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler + ### `parserOptions.project` Default `undefined`. diff --git a/packages/parser/package.json b/packages/parser/package.json index eedfb438f86..623d59bb6b0 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -43,16 +43,17 @@ "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "dependencies": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.10.1", "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/scope-manager": "3.10.1", "@typescript-eslint/typescript-estree": "3.10.1", - "eslint-visitor-keys": "^1.1.0" + "debug": "^4.1.1" }, "devDependencies": { "@types/glob": "^7.1.1", + "@typescript-eslint/experimental-utils": "3.10.1", "@typescript-eslint/shared-fixtures": "3.10.1", - "glob": "*" + "glob": "*", + "typescript": "*" }, "peerDependenciesMeta": { "typescript": { diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts deleted file mode 100644 index b2b9f056311..00000000000 --- a/packages/parser/src/analyze-scope.ts +++ /dev/null @@ -1,866 +0,0 @@ -import { TSESLintScope } from '@typescript-eslint/experimental-utils'; -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; -import { visitorKeys as childVisitorKeys } from '@typescript-eslint/typescript-estree'; -import { getKeys as fallback } from 'eslint-visitor-keys'; - -import { ParserOptions } from './parser-options'; -import { ScopeManager } from './scope/scope-manager'; - -/** - * Define the override function of `Scope#__define` for global augmentation. - * @param {Function} define The original Scope#__define method. - * @returns {Function} The override function. - */ -function overrideDefine( - define: (node: TSESTree.Node, def: TSESLintScope.Definition) => void, -) { - return function ( - this: TSESLintScope.Scope, - node: TSESTree.Node, - definition: TSESLintScope.Definition, - ): void { - define.call(this, node, definition); - - // Set `variable.eslintUsed` to tell ESLint that the variable is exported. - const variable = - 'name' in node && - typeof node.name === 'string' && - this.set.get(node.name); - if (variable) { - variable.eslintUsed = true; - } - }; -} - -class PatternVisitor extends TSESLintScope.PatternVisitor { - constructor( - options: TSESLintScope.PatternVisitorOptions, - rootPattern: TSESTree.BaseNode, - callback: TSESLintScope.PatternVisitorCallback, - ) { - super(options, rootPattern, callback); - } - - Identifier(node: TSESTree.Identifier): void { - super.Identifier(node); - if (node.decorators) { - this.rightHandNodes.push(...node.decorators); - } - if (node.typeAnnotation) { - this.rightHandNodes.push(node.typeAnnotation); - } - } - - ArrayPattern(node: TSESTree.ArrayPattern): void { - node.elements.forEach(this.visit, this); - if (node.decorators) { - this.rightHandNodes.push(...node.decorators); - } - if (node.typeAnnotation) { - this.rightHandNodes.push(node.typeAnnotation); - } - } - - ObjectPattern(node: TSESTree.ObjectPattern): void { - node.properties.forEach(this.visit, this); - if (node.decorators) { - this.rightHandNodes.push(...node.decorators); - } - if (node.typeAnnotation) { - this.rightHandNodes.push(node.typeAnnotation); - } - } - - RestElement(node: TSESTree.RestElement): void { - super.RestElement(node); - if (node.decorators) { - this.rightHandNodes.push(...node.decorators); - } - if (node.typeAnnotation) { - this.rightHandNodes.push(node.typeAnnotation); - } - } - - TSParameterProperty(node: TSESTree.TSParameterProperty): void { - this.visit(node.parameter); - if (node.decorators) { - this.rightHandNodes.push(...node.decorators); - } - } -} - -class Referencer extends TSESLintScope.Referencer { - protected typeMode: boolean; - - constructor( - options: TSESLintScope.ScopeManagerOptions, - scopeManager: ScopeManager, - ) { - super(options, scopeManager); - this.typeMode = false; - } - - /** - * Override to use PatternVisitor we overrode. - * @param node The Identifier node to visit. - * @param [options] The flag to visit right-hand side nodes. - * @param callback The callback function for left-hand side nodes. - */ - visitPattern( - node: T, - options: TSESLintScope.PatternVisitorOptions, - callback: TSESLintScope.PatternVisitorCallback, - ): void { - if (!node) { - return; - } - - if (typeof options === 'function') { - callback = options; - options = { processRightHandNodes: false }; - } - - const visitor = new PatternVisitor(this.options, node, callback); - visitor.visit(node); - - if (options.processRightHandNodes) { - visitor.rightHandNodes.forEach(this.visit, this); - } - } - - /** - * Override. - * Visit `node.typeParameters` and `node.returnType` additionally to find `typeof` expressions. - * @param node The function node to visit. - */ - visitFunction( - node: - | TSESTree.FunctionDeclaration - | TSESTree.FunctionExpression - | TSESTree.ArrowFunctionExpression, - ): void { - const { type, id, typeParameters, params, returnType, body } = node; - const scopeManager = this.scopeManager; - const upperScope = this.currentScope(); - - // Process the name. - if (type === AST_NODE_TYPES.FunctionDeclaration && id) { - upperScope.__define( - id, - new TSESLintScope.Definition( - 'FunctionName', - id, - node, - null, - null, - null, - ), - ); - - // Remove overload definition to avoid confusion of no-redeclare rule. - const { defs, identifiers } = upperScope.set.get(id.name)!; - for (let i = 0; i < defs.length; ++i) { - const def = defs[i]; - if ( - def.type === 'FunctionName' && - def.node.type === AST_NODE_TYPES.TSDeclareFunction - ) { - defs.splice(i, 1); - identifiers.splice(i, 1); - break; - } - } - } else if (type === AST_NODE_TYPES.FunctionExpression && id) { - scopeManager.__nestFunctionExpressionNameScope(node); - } - - // Open the function scope. - scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); - const innerScope = this.currentScope(); - - // Process the type parameters - this.visit(typeParameters); - - // Process parameter declarations. - for (let i = 0; i < params.length; ++i) { - this.visitPattern( - params[i], - { processRightHandNodes: true }, - (pattern, info) => { - if ( - pattern.type !== AST_NODE_TYPES.Identifier || - pattern.name !== 'this' - ) { - innerScope.__define( - pattern, - new TSESLintScope.ParameterDefinition( - pattern, - node, - i, - info.rest, - ), - ); - this.referencingDefaultValue(pattern, info.assignments, null, true); - } - }, - ); - } - - // Process the return type. - this.visit(returnType); - - // Process the body. - if (body && body.type === AST_NODE_TYPES.BlockStatement) { - this.visitChildren(body); - } else { - this.visit(body); - } - - // Close the function scope. - this.close(node); - } - - /** - * Override. - * Visit decorators. - * @param node The class node to visit. - */ - visitClass(node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void { - this.visitDecorators(node.decorators); - - const upperTypeMode = this.typeMode; - this.typeMode = true; - if (node.superTypeParameters) { - this.visit(node.superTypeParameters); - } - if (node.implements) { - node.implements.forEach(this.visit, this); - } - this.typeMode = upperTypeMode; - - super.visitClass(node); - } - - /** - * Visit typeParameters. - * @param node The node to visit. - */ - visitTypeParameters(node: { - typeParameters?: - | TSESTree.TSTypeParameterDeclaration - | TSESTree.TSTypeParameterInstantiation; - }): void { - if (node.typeParameters) { - const upperTypeMode = this.typeMode; - this.typeMode = true; - this.visit(node.typeParameters); - this.typeMode = upperTypeMode; - } - } - - /** - * Override. - */ - JSXOpeningElement(node: TSESTree.JSXOpeningElement): void { - this.visit(node.name); - this.visitTypeParameters(node); - node.attributes.forEach(this.visit, this); - } - - /** - * Override. - * Don't create the reference object in the type mode. - * @param node The Identifier node to visit. - */ - Identifier(node: TSESTree.Identifier): void { - this.visitDecorators(node.decorators); - - if (!this.typeMode) { - super.Identifier(node); - } - - this.visit(node.typeAnnotation); - } - - /** - * Override. - * Visit decorators. - * @param node The MethodDefinition node to visit. - */ - MethodDefinition( - node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition, - ): void { - this.visitDecorators(node.decorators); - super.MethodDefinition(node); - } - - /** - * Don't create the reference object for the key if not computed. - * @param node The ClassProperty node to visit. - */ - ClassProperty( - node: TSESTree.ClassProperty | TSESTree.TSAbstractClassProperty, - ): void { - const upperTypeMode = this.typeMode; - const { computed, decorators, key, typeAnnotation, value } = node; - - this.typeMode = false; - this.visitDecorators(decorators); - if (computed) { - this.visit(key); - } - this.typeMode = true; - this.visit(typeAnnotation); - this.typeMode = false; - this.visit(value); - - this.typeMode = upperTypeMode; - } - - /** - * Visit new expression. - * @param node The NewExpression node to visit. - */ - NewExpression(node: TSESTree.NewExpression): void { - this.visitTypeParameters(node); - this.visit(node.callee); - - node.arguments.forEach(this.visit, this); - } - - /** - * Override. - * Visit call expression. - * @param node The CallExpression node to visit. - */ - CallExpression(node: TSESTree.CallExpression): 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. - * @param node The TSDeclareFunction node to visit. - */ - TSDeclareFunction(node: TSESTree.TSDeclareFunction): void { - const scopeManager = this.scopeManager; - const upperScope = this.currentScope(); - const { id, typeParameters, params, returnType } = node; - - // Ignore this if other overload have already existed. - if (id) { - const variable = upperScope.set.get(id.name); - const defs = variable?.defs; - const existed = defs?.some((d): boolean => d.type === 'FunctionName'); - if (!existed) { - upperScope.__define( - id, - new TSESLintScope.Definition( - 'FunctionName', - id, - node, - null, - null, - null, - ), - ); - } - } - - // Open the function scope. - scopeManager.__nestEmptyFunctionScope(node); - const innerScope = this.currentScope(); - - // Process the type parameters - this.visit(typeParameters); - - // Process parameter declarations. - for (let i = 0; i < params.length; ++i) { - this.visitPattern( - params[i], - { processRightHandNodes: true }, - (pattern, info) => { - innerScope.__define( - pattern, - new TSESLintScope.ParameterDefinition(pattern, node, i, info.rest), - ); - - // Set `variable.eslintUsed` to tell ESLint that the variable is used. - const variable = innerScope.set.get(pattern.name); - if (variable) { - variable.eslintUsed = true; - } - this.referencingDefaultValue(pattern, info.assignments, null, true); - }, - ); - } - - // Process the return type. - this.visit(returnType); - - // Close the function scope. - this.close(node); - } - - /** - * Create reference objects for the references in parameters and return type. - * @param node The TSEmptyBodyFunctionExpression node to visit. - */ - TSEmptyBodyFunctionExpression( - node: TSESTree.TSEmptyBodyFunctionExpression, - ): void { - const upperTypeMode = this.typeMode; - const { typeParameters, params, returnType } = node; - - this.typeMode = true; - this.visit(typeParameters); - params.forEach(this.visit, this); - this.visit(returnType); - this.typeMode = upperTypeMode; - } - - /** - * Don't make variable because it declares only types. - * Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations. - * @param node The TSInterfaceDeclaration node to visit. - */ - TSInterfaceDeclaration(node: TSESTree.TSInterfaceDeclaration): void { - this.visitTypeNodes(node); - } - - /** - * Don't make variable because it declares only types. - * Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations. - * @param node The TSClassImplements node to visit. - */ - TSClassImplements(node: TSESTree.TSClassImplements): void { - this.visitTypeNodes(node); - } - - /** - * Don't make variable because it declares only types. - * Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations. - * @param node The TSIndexSignature node to visit. - */ - TSIndexSignature(node: TSESTree.TSIndexSignature): void { - this.visitTypeNodes(node); - } - - /** - * Visit type assertion. - * @param node The TSTypeAssertion node to visit. - */ - TSTypeAssertion(node: TSESTree.TSTypeAssertion): void { - if (this.typeMode) { - this.visit(node.typeAnnotation); - } else { - this.typeMode = true; - this.visit(node.typeAnnotation); - this.typeMode = false; - } - - this.visit(node.expression); - } - - /** - * Visit as expression. - * @param node The TSAsExpression node to visit. - */ - TSAsExpression(node: TSESTree.TSAsExpression): void { - this.visit(node.expression); - - if (this.typeMode) { - this.visit(node.typeAnnotation); - } else { - this.typeMode = true; - this.visit(node.typeAnnotation); - this.typeMode = false; - } - } - - /** - * Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations. - * @param node The TSTypeAnnotation node to visit. - */ - TSTypeAnnotation(node: TSESTree.TSTypeAnnotation): void { - this.visitTypeNodes(node); - } - - /** - * Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations. - * @param node The TSTypeParameterDeclaration node to visit. - */ - TSTypeParameterDeclaration(node: TSESTree.TSTypeParameterDeclaration): void { - this.visitTypeNodes(node); - } - - /** - * Create reference objects for the references in `typeof` expression. - * @param node The TSTypeQuery node to visit. - */ - TSTypeQuery(node: TSESTree.TSTypeQuery): void { - if (this.typeMode) { - this.typeMode = false; - this.visitChildren(node); - this.typeMode = true; - } else { - this.visitChildren(node); - } - } - - /** - * @param node The TSTypeParameter node to visit. - */ - TSTypeParameter(node: TSESTree.TSTypeParameter): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSInferType node to visit. - */ - TSInferType(node: TSESTree.TSInferType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSTypeReference node to visit. - */ - TSTypeReference(node: TSESTree.TSTypeReference): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSTypeLiteral node to visit. - */ - TSTypeLiteral(node: TSESTree.TSTypeLiteral): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSLiteralType node to visit. - */ - TSLiteralType(node: TSESTree.TSLiteralType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSIntersectionType node to visit. - */ - TSIntersectionType(node: TSESTree.TSIntersectionType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSConditionalType node to visit. - */ - TSConditionalType(node: TSESTree.TSConditionalType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSIndexedAccessType node to visit. - */ - TSIndexedAccessType(node: TSESTree.TSIndexedAccessType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSMappedType node to visit. - */ - TSMappedType(node: TSESTree.TSMappedType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSOptionalType node to visit. - */ - TSOptionalType(node: TSESTree.TSOptionalType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSParenthesizedType node to visit. - */ - TSParenthesizedType(node: TSESTree.TSParenthesizedType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSRestType node to visit. - */ - TSRestType(node: TSESTree.TSRestType): void { - this.visitTypeNodes(node); - } - - /** - * @param node The TSTupleType node to visit. - */ - TSTupleType(node: TSESTree.TSTupleType): void { - this.visitTypeNodes(node); - } - - /** - * Create reference objects for the object part. (This is `obj.prop`) - * @param node The TSQualifiedName node to visit. - */ - TSQualifiedName(node: TSESTree.TSQualifiedName): void { - this.visit(node.left); - } - - /** - * Create reference objects for the references in computed keys. - * @param node The TSPropertySignature node to visit. - */ - TSPropertySignature(node: TSESTree.TSPropertySignature): void { - const upperTypeMode = this.typeMode; - const { computed, key, typeAnnotation, initializer } = node; - - if (computed) { - this.typeMode = false; - this.visit(key); - this.typeMode = true; - } else { - this.typeMode = true; - this.visit(key); - } - this.visit(typeAnnotation); - this.visit(initializer); - - this.typeMode = upperTypeMode; - } - - /** - * Create reference objects for the references in computed keys. - * @param node The TSMethodSignature node to visit. - */ - TSMethodSignature(node: TSESTree.TSMethodSignature): void { - const upperTypeMode = this.typeMode; - const { computed, key, typeParameters, params, returnType } = node; - - if (computed) { - this.typeMode = false; - this.visit(key); - this.typeMode = true; - } else { - this.typeMode = true; - this.visit(key); - } - this.visit(typeParameters); - params.forEach(this.visit, this); - this.visit(returnType); - - this.typeMode = upperTypeMode; - } - - /** - * Create variable object for the enum. - * The enum declaration creates a scope for the enum members. - * - * enum E { - * A, - * B, - * C = A + B // A and B are references to the enum member. - * } - * - * const a = 0 - * enum E { - * A = a // a is above constant. - * } - * - * @param node The TSEnumDeclaration node to visit. - */ - TSEnumDeclaration(node: TSESTree.TSEnumDeclaration): void { - const { id, members } = node; - const scopeManager = this.scopeManager; - const scope = this.currentScope(); - - if (id) { - scope.__define(id, new TSESLintScope.Definition('EnumName', id, node)); - } - - scopeManager.__nestEnumScope(node); - for (const member of members) { - this.visit(member); - } - this.close(node); - } - - /** - * Create variable object for the enum member and create reference object for the initializer. - * And visit the initializer. - * - * @param node The TSEnumMember node to visit. - */ - TSEnumMember(node: TSESTree.TSEnumMember): void { - const { id, initializer } = node; - const scope = this.currentScope(); - - scope.__define( - id, - new TSESLintScope.Definition('EnumMemberName', id, node), - ); - if (initializer) { - scope.__referencing( - id, - TSESLintScope.Reference.WRITE, - initializer, - null, - false, - true, - ); - this.visit(initializer); - } - } - - /** - * Create the variable object for the module name, and visit children. - * @param node The TSModuleDeclaration node to visit. - */ - TSModuleDeclaration(node: TSESTree.TSModuleDeclaration): void { - const scope = this.currentScope(); - const { id, body } = node; - - if (node.global) { - this.visitGlobalAugmentation(node); - return; - } - - if (id && id.type === AST_NODE_TYPES.Identifier) { - scope.__define( - id, - new TSESLintScope.Definition( - 'NamespaceName', - id, - node, - null, - null, - null, - ), - ); - } - this.visit(body); - } - - TSTypeAliasDeclaration(node: TSESTree.TSTypeAliasDeclaration): void { - this.typeMode = true; - this.visitChildren(node); - this.typeMode = false; - } - - /** - * Process the module block. - * @param node The TSModuleBlock node to visit. - */ - TSModuleBlock(node: TSESTree.TSModuleBlock): void { - this.scopeManager.__nestBlockScope(node); - this.visitChildren(node); - this.close(node); - } - - TSAbstractClassProperty(node: TSESTree.TSAbstractClassProperty): void { - this.ClassProperty(node); - } - TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void { - this.MethodDefinition(node); - } - - /** - * Process import equal declaration - * @param node The TSImportEqualsDeclaration node to visit. - */ - TSImportEqualsDeclaration(node: TSESTree.TSImportEqualsDeclaration): void { - const { id, moduleReference } = node; - if (id && id.type === AST_NODE_TYPES.Identifier) { - this.currentScope().__define( - id, - new TSESLintScope.Definition( - 'ImportBinding', - id, - node, - null, - null, - null, - ), - ); - } - this.visit(moduleReference); - } - - /** - * Process the global augmentation. - * 1. Set the global scope as the current scope. - * 2. Configure the global scope to set `variable.eslintUsed = true` for all defined variables. This means `no-unused-vars` doesn't warn those. - * @param node The TSModuleDeclaration node to visit. - */ - visitGlobalAugmentation(node: TSESTree.TSModuleDeclaration): void { - const scopeManager = this.scopeManager; - const currentScope = this.currentScope(); - const globalScope = scopeManager.globalScope; - const originalDefine = globalScope.__define; - - globalScope.__define = overrideDefine(originalDefine); - scopeManager.__currentScope = globalScope; - - // Skip TSModuleBlock to avoid to create that block scope. - if (node.body && node.body.type === AST_NODE_TYPES.TSModuleBlock) { - node.body.body.forEach(this.visit, this); - } - - scopeManager.__currentScope = currentScope; - globalScope.__define = originalDefine; - } - - /** - * Process decorators. - * @param decorators The decorator nodes to visit. - */ - visitDecorators(decorators?: TSESTree.Decorator[]): void { - if (decorators) { - decorators.forEach(this.visit, this); - } - } - - /** - * Process all child of type nodes - * @param node node to be processed - */ - visitTypeNodes(node: TSESTree.Node): void { - if (this.typeMode) { - this.visitChildren(node); - } else { - this.typeMode = true; - this.visitChildren(node); - this.typeMode = false; - } - } -} - -export function analyzeScope( - ast: TSESTree.Program, - parserOptions: ParserOptions, -): ScopeManager { - const options = { - ignoreEval: true, - optimistic: false, - directive: false, - nodejsScope: - parserOptions.sourceType === 'script' && - parserOptions.ecmaFeatures?.globalReturn === true, - impliedStrict: false, - sourceType: parserOptions.sourceType, - ecmaVersion: parserOptions.ecmaVersion ?? 2018, - childVisitorKeys, - fallback, - }; - - const scopeManager = new ScopeManager(options); - const referencer = new Referencer(options, scopeManager); - - referencer.visit(ast); - - return scopeManager; -} diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index 64c81253440..263779207c9 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -1,11 +1,15 @@ -import { ParserOptions, TSESTree } from '@typescript-eslint/types'; +import { ParserOptions, TSESTree, Lib } from '@typescript-eslint/types'; import { parseAndGenerateServices, ParserServices, TSESTreeOptions, visitorKeys, } from '@typescript-eslint/typescript-estree'; -import { analyzeScope } from './analyze-scope'; +import { analyze, ScopeManager } from '@typescript-eslint/scope-manager'; +import debug from 'debug'; +import { ScriptTarget } from 'typescript'; + +const log = debug('typescript-eslint:parser:parser'); interface ParseForESLintResult { ast: TSESTree.Program & { @@ -15,7 +19,7 @@ interface ParseForESLintResult { }; services: ParserServices; visitorKeys: typeof visitorKeys; - scopeManager: ReturnType; + scopeManager: ScopeManager; } function validateBoolean( @@ -28,6 +32,44 @@ function validateBoolean( return value; } +const LIB_FILENAME_REGEX = /lib\.(.+)\.d\.ts/; +function getLib(services: ParserServices): Lib[] { + const compilerOptions = services.program.getCompilerOptions(); + if (compilerOptions.lib) { + return compilerOptions.lib + .map(lib => { + const match = LIB_FILENAME_REGEX.exec(lib.toLowerCase()); + if (!match) { + return null; + } + + return match[1] as Lib; + }) + .filter(l => l != null) as Lib[]; + } + + const target = compilerOptions.target ?? ScriptTarget.ES5; + // https://github.com/Microsoft/TypeScript/blob/59ad375234dc2efe38d8ee0ba58414474c1d5169/src/compiler/utilitiesPublic.ts#L13-L32 + switch (target) { + case ScriptTarget.ESNext: + return ['esnext.full']; + case ScriptTarget.ES2020: + return ['es2020.full']; + case ScriptTarget.ES2019: + return ['es2019.full']; + case ScriptTarget.ES2018: + return ['es2018.full']; + case ScriptTarget.ES2017: + return ['es2017.full']; + case ScriptTarget.ES2016: + return ['es2016.full']; + case ScriptTarget.ES2015: + return ['es6']; + default: + return ['lib']; + } +} + function parse( code: string, options?: ParserOptions, @@ -41,6 +83,8 @@ function parseForESLint( ): ParseForESLintResult { if (!options || typeof options !== 'object') { options = {}; + } else { + options = { ...options }; } // https://eslint.org/docs/user-guide/configuring#specifying-parser-options // if sourceType is not provided by default eslint expect that it will be set to "script" @@ -79,7 +123,20 @@ function parseForESLint( const { ast, services } = parseAndGenerateServices(code, parserOptions); ast.sourceType = options.sourceType; - const scopeManager = analyzeScope(ast, options); + // automatically apply the libs configured for the program + if (services.hasFullTypeInformation && options.lib == null) { + options.lib = getLib(services); + log('Resolved libs from program: %o', options.lib); + } + + const analyzeOptions = { + ecmaVersion: options.ecmaVersion, + globalReturn: options.ecmaFeatures.globalReturn, + lib: options.lib, + sourceType: options.sourceType, + }; + const scopeManager = analyze(ast, analyzeOptions); + return { ast, services, scopeManager, visitorKeys }; } diff --git a/packages/parser/src/scope/scope-manager.ts b/packages/parser/src/scope/scope-manager.ts deleted file mode 100644 index ae6fceaf1c6..00000000000 --- a/packages/parser/src/scope/scope-manager.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { TSESLintScope } from '@typescript-eslint/experimental-utils'; -import { TSESTree } from '@typescript-eslint/types'; -import { EmptyFunctionScope, EnumScope } from './scopes'; - -/** - * based on eslint-scope - */ -export class ScopeManager extends TSESLintScope.ScopeManager { - scopes!: TSESLintScope.Scope[]; - globalScope!: TSESLintScope.Scope; - - constructor(options: TSESLintScope.ScopeManagerOptions) { - super(options); - } - - /** @internal */ - __nestEnumScope(node: TSESTree.TSEnumDeclaration): TSESLintScope.Scope { - return this.__nestScope(new EnumScope(this, this.__currentScope, node)); - } - - /** @internal */ - __nestEmptyFunctionScope( - node: TSESTree.TSDeclareFunction, - ): TSESLintScope.Scope { - return this.__nestScope( - new EmptyFunctionScope(this, this.__currentScope, node), - ); - } -} diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts deleted file mode 100644 index 97ef3d60092..00000000000 --- a/packages/parser/src/scope/scopes.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { TSESLintScope } from '@typescript-eslint/experimental-utils'; -import { TSESTree } from '@typescript-eslint/types'; -import { ScopeManager } from './scope-manager'; - -/** The scope class for enum. */ -export class EnumScope extends TSESLintScope.Scope { - constructor( - scopeManager: ScopeManager, - upperScope: TSESLintScope.Scope, - block: TSESTree.TSEnumDeclaration | null, - ) { - super(scopeManager, 'enum', upperScope, block, false); - } -} - -/** The scope class for empty functions. */ -export class EmptyFunctionScope extends TSESLintScope.Scope { - constructor( - scopeManager: ScopeManager, - upperScope: TSESLintScope.Scope, - block: TSESTree.TSDeclareFunction | null, - ) { - super(scopeManager, 'empty-function', upperScope, block, false); - } -} diff --git a/packages/parser/tests/lib/__snapshots__/basics.ts.snap b/packages/parser/tests/lib/__snapshots__/basics.ts.snap deleted file mode 100644 index 9678bad3ece..00000000000 --- a/packages/parser/tests/lib/__snapshots__/basics.ts.snap +++ /dev/null @@ -1,1292 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`basics fixtures/delete-expression.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "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[`basics fixtures/do-while-statements.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 59, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 59, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 29, - 43, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 39, - 40, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 23, - 24, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 51, - 52, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "i": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 15, - 25, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 2, - }, - ], - "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[`basics fixtures/identifiers-double-underscore.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 20, - 36, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "__Foo": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 36, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - ], - "name": "__Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 38, - 59, - ], - "type": "FunctionDeclaration", - }, - "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 [ - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "__test", - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 17, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "__Bar": Object { - "$ref": 2, - }, - "__Foo": Object { - "$ref": 1, - }, - "__test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "__test", - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "__test", - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - }, - ], - "name": "__test", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 36, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - ], - "name": "__Foo", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "__Bar", - "range": Array [ - 47, - 52, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 38, - 59, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "__Bar", - "range": Array [ - 47, - 52, - ], - "type": "Identifier", - }, - ], - "name": "__Bar", - "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[`basics fixtures/instanceof.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "Set", - "range": Array [ - 14, - 17, - ], - "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[`basics fixtures/new-with-member-expression.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, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "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[`basics fixtures/new-without-parens.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "FunctionDeclaration", - }, - "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 [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "X", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "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 [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 16, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "X", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`basics fixtures/typeof-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 13, - ], - "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[`basics fixtures/update-expression.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 11, - 34, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": null, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 9, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "f": Object { - "$ref": 1, - }, - "i": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 34, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "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[`basics fixtures/void-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 17, - ], - "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 [], -} -`; diff --git a/packages/parser/tests/lib/__snapshots__/comments.ts.snap b/packages/parser/tests/lib/__snapshots__/comments.ts.snap deleted file mode 100644 index 174ae49f697..00000000000 --- a/packages/parser/tests/lib/__snapshots__/comments.ts.snap +++ /dev/null @@ -1,20131 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Comments fixtures/block-trailing-comment.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "optional": false, - "range": Array [ - 6, - 9, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 26, - ], - "type": "BlockStatement", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 15, - 24, - ], - "type": "Line", - "value": "comment", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 27, - ], - "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": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/comment-within-condition.src 1`] = ` -Object { - "body": Array [ - Object { - "alternate": null, - "consequent": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 28, - 30, - ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 10, - 30, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "type": "IfStatement", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 9, - ], - "type": "Block", - "value": " foo ", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 23, - ], - "type": "Block", - "value": " bar ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 10, - 31, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 10, - 12, - ], - "type": "Keyword", - "value": "if", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 2, - }, - "start": Object { - "column": 3, - "line": 2, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 27, - ], - "type": "Punctuator", - "value": ")", - }, - 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": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/export-default-anonymous-class.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "name": "method1", - "range": Array [ - 103, - 110, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 5, - "line": 9, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 103, - 119, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 9, - }, - "start": Object { - "column": 13, - "line": 8, - }, - }, - "range": Array [ - 112, - 119, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 9, - }, - "start": Object { - "column": 11, - "line": 8, - }, - }, - "params": Array [], - "range": Array [ - 110, - 119, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "range": Array [ - 57, - 121, - ], - "type": "ClassBody", - }, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 15, - "line": 4, - }, - }, - "range": Array [ - 51, - 121, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - "exportKind": "value", - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 36, - 121, - ], - "type": "ExportDefaultDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 35, - ], - "type": "Block", - "value": "* - * this is anonymous class. - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 63, - 98, - ], - "type": "Block", - "value": "* - * this is method1. - ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 11, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 36, - 122, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 36, - 42, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 7, - "line": 4, - }, - }, - "range": Array [ - 43, - 50, - ], - "type": "Keyword", - "value": "default", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 4, - }, - }, - "range": Array [ - 51, - 56, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 103, - 110, - ], - "type": "Identifier", - "value": "method1", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 8, - }, - "start": Object { - "column": 11, - "line": 8, - }, - }, - "range": Array [ - 110, - 111, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 8, - }, - "start": Object { - "column": 12, - "line": 8, - }, - }, - "range": Array [ - 111, - 112, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 13, - "line": 8, - }, - }, - "range": Array [ - 112, - 113, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 9, - }, - "start": Object { - "column": 4, - "line": 9, - }, - }, - "range": Array [ - 118, - 119, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 10, - }, - }, - "range": Array [ - 120, - 121, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsdoc-comment.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 11, - "line": 7, - }, - }, - "name": "bar", - "range": Array [ - 130, - 133, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "range": Array [ - 123, - 134, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 8, - }, - "start": Object { - "column": 18, - "line": 6, - }, - }, - "range": Array [ - 117, - 136, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 108, - 111, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 6, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 6, - }, - }, - "name": "bar", - "range": Array [ - 112, - 115, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 99, - 136, - ], - "type": "FunctionDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 98, - ], - "type": "Block", - "value": "* - * This is a function. - * @param {String} bar some string - * @returns {String} returns bar - ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 6, - }, - }, - "range": Array [ - 99, - 137, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 6, - }, - }, - "range": Array [ - 99, - 107, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 108, - 111, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 6, - }, - }, - "range": Array [ - 111, - 112, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 6, - }, - }, - "range": Array [ - 112, - 115, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 6, - }, - "start": Object { - "column": 16, - "line": 6, - }, - }, - "range": Array [ - 115, - 116, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 6, - }, - "start": Object { - "column": 18, - "line": 6, - }, - }, - "range": Array [ - 117, - 118, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "range": Array [ - 123, - 129, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 11, - "line": 7, - }, - }, - "range": Array [ - 130, - 133, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 7, - }, - "start": Object { - "column": 14, - "line": 7, - }, - }, - "range": Array [ - 133, - 134, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 8, - }, - }, - "range": Array [ - 135, - 136, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-attr-and-text-with-url.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "link", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 61, - "line": 1, - }, - "start": Object { - "column": 43, - "line": 1, - }, - }, - "range": Array [ - 43, - 61, - ], - "raw": "http://example.com", - "type": "JSXText", - "value": "http://example.com", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 65, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 63, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 63, - 64, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 61, - 65, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 65, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "openingElement": Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "href", - "range": Array [ - 17, - 21, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 17, - 42, - ], - "type": "JSXAttribute", - "value": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 42, - ], - "raw": "\\"http://example.com\\"", - "type": "Literal", - "value": "http://example.com", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 15, - 16, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 14, - 43, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 14, - 65, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 66, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 66, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 67, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 67, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 68, - ], - "sourceType": "module", - "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": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - "value": "link", - }, - 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": 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": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "JSXIdentifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 21, - ], - "type": "JSXIdentifier", - "value": "href", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 42, - ], - "type": "JSXText", - "value": "\\"http://example.com\\"", - }, - 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": 61, - "line": 1, - }, - "start": Object { - "column": 43, - "line": 1, - }, - }, - "range": Array [ - 43, - 61, - ], - "type": "JSXText", - "value": "http://example.com", - }, - Object { - "loc": Object { - "end": Object { - "column": 62, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, - }, - "range": Array [ - 61, - 62, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 63, - "line": 1, - }, - "start": Object { - "column": 62, - "line": 1, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 63, - "line": 1, - }, - }, - "range": Array [ - 63, - 64, - ], - "type": "JSXIdentifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 65, - "line": 1, - }, - "start": Object { - "column": 64, - "line": 1, - }, - }, - "range": Array [ - 64, - 65, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 66, - "line": 1, - }, - "start": Object { - "column": 65, - "line": 1, - }, - }, - "range": Array [ - 65, - 66, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 67, - "line": 1, - }, - "start": Object { - "column": 66, - "line": 1, - }, - }, - "range": Array [ - 66, - 67, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-block-comment.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "pure", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 47, - 60, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 4, - }, - }, - "range": Array [ - 61, - 72, - ], - "type": "JSXEmptyExpression", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "range": Array [ - 60, - 73, - ], - "type": "JSXExpressionContainer", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 25, - "line": 4, - }, - }, - "range": Array [ - 73, - 82, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 5, - }, - "start": Object { - "column": 10, - "line": 5, - }, - }, - "name": "Foo", - "range": Array [ - 84, - 87, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 82, - 88, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "Foo", - "range": Array [ - 43, - 46, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 42, - 47, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 42, - 88, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 95, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 97, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 13, - 97, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 97, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 97, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 4, - }, - }, - "range": Array [ - 61, - 72, - ], - "type": "Block", - "value": "COMMENT", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 98, - ], - "sourceType": "module", - "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": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - "value": "pure", - }, - 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": 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": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "Punctuator", - "value": "=>", - }, - 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": 10, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 31, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 46, - 47, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 47, - 60, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "range": Array [ - 60, - 61, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 4, - }, - "start": Object { - "column": 24, - "line": 4, - }, - }, - "range": Array [ - 72, - 73, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 25, - "line": 4, - }, - }, - "range": Array [ - 73, - 82, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 82, - 83, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 5, - }, - "start": Object { - "column": 9, - "line": 5, - }, - }, - "range": Array [ - 83, - 84, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 5, - }, - "start": Object { - "column": 10, - "line": 5, - }, - }, - "range": Array [ - 84, - 87, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 5, - }, - }, - "range": Array [ - 87, - 88, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 93, - 94, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 6, - }, - "start": Object { - "column": 5, - "line": 6, - }, - }, - "range": Array [ - 94, - 95, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 96, - 97, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-comment-after-jsx.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "pure", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "Foo", - "range": Array [ - 49, - 52, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 47, - 53, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "Foo", - "range": Array [ - 43, - 46, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 42, - 47, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 42, - 53, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 67, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 69, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 13, - 69, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 69, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 69, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 3, - }, - }, - "range": Array [ - 54, - 60, - ], - "type": "Line", - "value": " Foo", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 70, - ], - "sourceType": "module", - "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": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - "value": "pure", - }, - 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": 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": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "Punctuator", - "value": "=>", - }, - 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": 10, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 31, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 46, - 47, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 47, - 48, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 48, - 49, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 49, - 52, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "range": Array [ - 52, - 53, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 65, - 66, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, - }, - }, - "range": Array [ - 66, - 67, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 68, - 69, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-comment-after-self-closing-jsx.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "pure", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "children": Array [], - "closingElement": null, - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "Foo", - "range": Array [ - 43, - 46, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 42, - 49, - ], - "selfClosing": true, - "type": "JSXOpeningElement", - }, - "range": Array [ - 42, - 49, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 63, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 65, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 13, - 65, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 65, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 65, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, - }, - }, - "range": Array [ - 50, - 56, - ], - "type": "Line", - "value": " Foo", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 66, - ], - "sourceType": "module", - "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": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - "value": "pure", - }, - 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": 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": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "Punctuator", - "value": "=>", - }, - 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": 10, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 31, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 47, - 48, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 48, - 49, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 61, - 62, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 64, - 65, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-generic-with-comment-in-tag.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "comp", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 19, - 24, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 3, - }, - "start": Object { - "column": 38, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 49, - "line": 3, - }, - "start": Object { - "column": 40, - "line": 3, - }, - }, - "name": "Component", - "range": Array [ - 60, - 69, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 58, - 70, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 50, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 38, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "name": "Component", - "range": Array [ - 25, - 34, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 24, - 58, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "TSNumberKeyword", - }, - ], - "range": Array [ - 34, - 42, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "range": Array [ - 24, - 70, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 4, - }, - "start": Object { - "column": 50, - "line": 3, - }, - }, - "range": Array [ - 70, - 75, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 4, - }, - "start": Object { - "column": 42, - "line": 4, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 4, - }, - "start": Object { - "column": 44, - "line": 4, - }, - }, - "name": "Component", - "range": Array [ - 115, - 124, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 113, - 125, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 54, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "openingElement": Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 23, - "line": 4, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 23, - "line": 4, - }, - }, - "name": "foo", - "range": Array [ - 94, - 97, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 94, - 97, - ], - "type": "JSXAttribute", - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, - }, - }, - "name": "Component", - "range": Array [ - 76, - 85, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 75, - 113, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 4, - }, - }, - "range": Array [ - 86, - 92, - ], - "type": "TSNumberKeyword", - }, - ], - "range": Array [ - 85, - 93, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "range": Array [ - 75, - 125, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 54, - "line": 4, - }, - }, - "range": Array [ - 125, - 130, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 42, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 5, - }, - "start": Object { - "column": 44, - "line": 5, - }, - }, - "name": "Component", - "range": Array [ - 170, - 179, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 168, - 180, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "openingElement": Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 5, - }, - "start": Object { - "column": 38, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 5, - }, - "start": Object { - "column": 38, - "line": 5, - }, - }, - "name": "bar", - "range": Array [ - 164, - 167, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 164, - 167, - ], - "type": "JSXAttribute", - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 5, - "line": 5, - }, - }, - "name": "Component", - "range": Array [ - 131, - 140, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 130, - 168, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 5, - }, - "start": Object { - "column": 15, - "line": 5, - }, - }, - "range": Array [ - 141, - 147, - ], - "type": "TSNumberKeyword", - }, - ], - "range": Array [ - 140, - 148, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "range": Array [ - 130, - 180, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 6, - }, - "start": Object { - "column": 54, - "line": 5, - }, - }, - "range": Array [ - 180, - 185, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 6, - }, - "start": Object { - "column": 46, - "line": 6, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 6, - }, - "start": Object { - "column": 48, - "line": 6, - }, - }, - "name": "Component", - "range": Array [ - 229, - 238, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 227, - 239, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 58, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "openingElement": Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 6, - }, - "start": Object { - "column": 23, - "line": 6, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 6, - }, - "start": Object { - "column": 23, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 204, - 207, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 204, - 207, - ], - "type": "JSXAttribute", - "value": null, - }, - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 6, - }, - "start": Object { - "column": 42, - "line": 6, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 6, - }, - "start": Object { - "column": 42, - "line": 6, - }, - }, - "name": "bar", - "range": Array [ - 223, - 226, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 223, - 226, - ], - "type": "JSXAttribute", - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 46, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 5, - "line": 6, - }, - }, - "name": "Component", - "range": Array [ - 186, - 195, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 185, - 227, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 6, - }, - "start": Object { - "column": 14, - "line": 6, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 6, - }, - "start": Object { - "column": 15, - "line": 6, - }, - }, - "range": Array [ - 196, - 202, - ], - "type": "TSNumberKeyword", - }, - ], - "range": Array [ - 195, - 203, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "range": Array [ - 185, - 239, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 8, - }, - "start": Object { - "column": 58, - "line": 6, - }, - }, - "range": Array [ - 239, - 245, - ], - "raw": " - - ", - "type": "JSXText", - "value": " - - ", - }, - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 10, - }, - "start": Object { - "column": 5, - "line": 10, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 10, - }, - "start": Object { - "column": 7, - "line": 10, - }, - }, - "name": "Component", - "range": Array [ - 289, - 298, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 287, - 299, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 10, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 10, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 5, - "line": 8, - }, - }, - "name": "Component", - "range": Array [ - 246, - 255, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 245, - 287, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 8, - }, - "start": Object { - "column": 14, - "line": 8, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 8, - }, - "start": Object { - "column": 15, - "line": 8, - }, - }, - "range": Array [ - 256, - 262, - ], - "type": "TSNumberKeyword", - }, - ], - "range": Array [ - 255, - 263, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "range": Array [ - 245, - 299, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 11, - }, - "start": Object { - "column": 17, - "line": 10, - }, - }, - "range": Array [ - 299, - 304, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 14, - }, - "start": Object { - "column": 5, - "line": 14, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 14, - }, - "start": Object { - "column": 7, - "line": 14, - }, - }, - "name": "Component", - "range": Array [ - 358, - 367, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 356, - 368, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 14, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "openingElement": Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 12, - }, - "start": Object { - "column": 6, - "line": 12, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 12, - }, - "start": Object { - "column": 6, - "line": 12, - }, - }, - "name": "foo", - "range": Array [ - 329, - 332, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 329, - 332, - ], - "type": "JSXAttribute", - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 14, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 11, - }, - "start": Object { - "column": 5, - "line": 11, - }, - }, - "name": "Component", - "range": Array [ - 305, - 314, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 304, - 356, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 11, - }, - "start": Object { - "column": 14, - "line": 11, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 11, - }, - "start": Object { - "column": 15, - "line": 11, - }, - }, - "range": Array [ - 315, - 321, - ], - "type": "TSNumberKeyword", - }, - ], - "range": Array [ - 314, - 322, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "range": Array [ - 304, - 368, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 15, - }, - "start": Object { - "column": 17, - "line": 14, - }, - }, - "range": Array [ - 368, - 373, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 18, - }, - "start": Object { - "column": 5, - "line": 18, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 18, - }, - "start": Object { - "column": 7, - "line": 18, - }, - }, - "name": "Component", - "range": Array [ - 427, - 436, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 425, - 437, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 18, - }, - "start": Object { - "column": 4, - "line": 15, - }, - }, - "openingElement": Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 17, - }, - "start": Object { - "column": 6, - "line": 17, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 17, - }, - "start": Object { - "column": 6, - "line": 17, - }, - }, - "name": "foo", - "range": Array [ - 416, - 419, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 416, - 419, - ], - "type": "JSXAttribute", - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 18, - }, - "start": Object { - "column": 4, - "line": 15, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 15, - }, - "start": Object { - "column": 5, - "line": 15, - }, - }, - "name": "Component", - "range": Array [ - 374, - 383, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 373, - 425, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 15, - }, - "start": Object { - "column": 14, - "line": 15, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 15, - }, - "start": Object { - "column": 15, - "line": 15, - }, - }, - "range": Array [ - 384, - 390, - ], - "type": "TSNumberKeyword", - }, - ], - "range": Array [ - 383, - 391, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "range": Array [ - 373, - 437, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 19, - }, - "start": Object { - "column": 17, - "line": 18, - }, - }, - "range": Array [ - 437, - 442, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 23, - }, - "start": Object { - "column": 5, - "line": 23, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 23, - }, - "start": Object { - "column": 7, - "line": 23, - }, - }, - "name": "Component", - "range": Array [ - 506, - 515, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 504, - 516, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 23, - }, - "start": Object { - "column": 4, - "line": 19, - }, - }, - "openingElement": Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 20, - }, - "start": Object { - "column": 6, - "line": 20, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 20, - }, - "start": Object { - "column": 6, - "line": 20, - }, - }, - "name": "foo", - "range": Array [ - 467, - 470, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 467, - 470, - ], - "type": "JSXAttribute", - "value": null, - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 22, - }, - "start": Object { - "column": 6, - "line": 22, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 22, - }, - "start": Object { - "column": 6, - "line": 22, - }, - }, - "name": "bar", - "range": Array [ - 495, - 498, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 495, - 498, - ], - "type": "JSXAttribute", - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 23, - }, - "start": Object { - "column": 4, - "line": 19, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 19, - }, - "start": Object { - "column": 5, - "line": 19, - }, - }, - "name": "Component", - "range": Array [ - 443, - 452, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 442, - 504, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 19, - }, - "start": Object { - "column": 14, - "line": 19, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 19, - }, - "start": Object { - "column": 15, - "line": 19, - }, - }, - "range": Array [ - 453, - 459, - ], - "type": "TSNumberKeyword", - }, - ], - "range": Array [ - 452, - 460, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "range": Array [ - 442, - 516, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 24, - }, - "start": Object { - "column": 17, - "line": 23, - }, - }, - "range": Array [ - 516, - 519, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - ], - "closingFragment": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 24, - }, - "start": Object { - "column": 2, - "line": 24, - }, - }, - "range": Array [ - 519, - 522, - ], - "type": "JSXClosingFragment", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 24, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "openingFragment": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 17, - 19, - ], - "type": "JSXOpeningFragment", - }, - "range": Array [ - 17, - 522, - ], - "type": "JSXFragment", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 25, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 524, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 2, - "line": 25, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 525, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 3, - }, - }, - "range": Array [ - 43, - 57, - ], - "type": "Block", - "value": " comment1 ", - }, - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 4, - }, - "start": Object { - "column": 27, - "line": 4, - }, - }, - "range": Array [ - 98, - 112, - ], - "type": "Block", - "value": " comment2 ", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 5, - }, - "start": Object { - "column": 23, - "line": 5, - }, - }, - "range": Array [ - 149, - 163, - ], - "type": "Block", - "value": " comment3 ", - }, - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 6, - }, - "start": Object { - "column": 27, - "line": 6, - }, - }, - "range": Array [ - 208, - 222, - ], - "type": "Block", - "value": " comment4 ", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 9, - }, - "start": Object { - "column": 6, - "line": 9, - }, - }, - "range": Array [ - 270, - 281, - ], - "type": "Line", - "value": " comment5", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 13, - }, - "start": Object { - "column": 6, - "line": 13, - }, - }, - "range": Array [ - 339, - 350, - ], - "type": "Line", - "value": " comment6", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 16, - }, - "start": Object { - "column": 6, - "line": 16, - }, - }, - "range": Array [ - 398, - 409, - ], - "type": "Line", - "value": " comment7", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 21, - }, - "start": Object { - "column": 6, - "line": 21, - }, - }, - "range": Array [ - 477, - 488, - ], - "type": "Line", - "value": " comment8", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 26, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 526, - ], - "sourceType": "module", - "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": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - "value": "comp", - }, - 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": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 2, - }, - "start": Object { - "column": 3, - "line": 2, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 19, - 24, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "range": Array [ - 25, - 34, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 34, - 35, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "range": Array [ - 41, - 42, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 3, - }, - "start": Object { - "column": 37, - "line": 3, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 38, - "line": 3, - }, - }, - "range": Array [ - 58, - 59, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 3, - }, - "start": Object { - "column": 39, - "line": 3, - }, - }, - "range": Array [ - 59, - 60, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 49, - "line": 3, - }, - "start": Object { - "column": 40, - "line": 3, - }, - }, - "range": Array [ - 60, - 69, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 3, - }, - "start": Object { - "column": 49, - "line": 3, - }, - }, - "range": Array [ - 69, - 70, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 4, - }, - "start": Object { - "column": 50, - "line": 3, - }, - }, - "range": Array [ - 70, - 75, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 75, - 76, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, - }, - }, - "range": Array [ - 76, - 85, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "range": Array [ - 85, - 86, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 4, - }, - }, - "range": Array [ - 86, - 92, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "range": Array [ - 92, - 93, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 23, - "line": 4, - }, - }, - "range": Array [ - 94, - 97, - ], - "type": "JSXIdentifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 4, - }, - "start": Object { - "column": 41, - "line": 4, - }, - }, - "range": Array [ - 112, - 113, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 4, - }, - "start": Object { - "column": 42, - "line": 4, - }, - }, - "range": Array [ - 113, - 114, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 4, - }, - "start": Object { - "column": 43, - "line": 4, - }, - }, - "range": Array [ - 114, - 115, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 4, - }, - "start": Object { - "column": 44, - "line": 4, - }, - }, - "range": Array [ - 115, - 124, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 4, - }, - "start": Object { - "column": 53, - "line": 4, - }, - }, - "range": Array [ - 124, - 125, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 54, - "line": 4, - }, - }, - "range": Array [ - 125, - 130, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 130, - 131, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 5, - "line": 5, - }, - }, - "range": Array [ - 131, - 140, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "range": Array [ - 140, - 141, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 5, - }, - "start": Object { - "column": 15, - "line": 5, - }, - }, - "range": Array [ - 141, - 147, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 5, - }, - "start": Object { - "column": 21, - "line": 5, - }, - }, - "range": Array [ - 147, - 148, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 5, - }, - "start": Object { - "column": 38, - "line": 5, - }, - }, - "range": Array [ - 164, - 167, - ], - "type": "JSXIdentifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 5, - }, - "start": Object { - "column": 41, - "line": 5, - }, - }, - "range": Array [ - 167, - 168, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 5, - }, - "start": Object { - "column": 42, - "line": 5, - }, - }, - "range": Array [ - 168, - 169, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 5, - }, - "start": Object { - "column": 43, - "line": 5, - }, - }, - "range": Array [ - 169, - 170, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 5, - }, - "start": Object { - "column": 44, - "line": 5, - }, - }, - "range": Array [ - 170, - 179, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 53, - "line": 5, - }, - }, - "range": Array [ - 179, - 180, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 6, - }, - "start": Object { - "column": 54, - "line": 5, - }, - }, - "range": Array [ - 180, - 185, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 185, - 186, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 5, - "line": 6, - }, - }, - "range": Array [ - 186, - 195, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 6, - }, - "start": Object { - "column": 14, - "line": 6, - }, - }, - "range": Array [ - 195, - 196, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 6, - }, - "start": Object { - "column": 15, - "line": 6, - }, - }, - "range": Array [ - 196, - 202, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 6, - }, - "start": Object { - "column": 21, - "line": 6, - }, - }, - "range": Array [ - 202, - 203, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 6, - }, - "start": Object { - "column": 23, - "line": 6, - }, - }, - "range": Array [ - 204, - 207, - ], - "type": "JSXIdentifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 6, - }, - "start": Object { - "column": 42, - "line": 6, - }, - }, - "range": Array [ - 223, - 226, - ], - "type": "JSXIdentifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 6, - }, - "start": Object { - "column": 45, - "line": 6, - }, - }, - "range": Array [ - 226, - 227, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 6, - }, - "start": Object { - "column": 46, - "line": 6, - }, - }, - "range": Array [ - 227, - 228, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 6, - }, - "start": Object { - "column": 47, - "line": 6, - }, - }, - "range": Array [ - 228, - 229, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 6, - }, - "start": Object { - "column": 48, - "line": 6, - }, - }, - "range": Array [ - 229, - 238, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 6, - }, - "start": Object { - "column": 57, - "line": 6, - }, - }, - "range": Array [ - 238, - 239, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 8, - }, - "start": Object { - "column": 58, - "line": 6, - }, - }, - "range": Array [ - 239, - 245, - ], - "type": "JSXText", - "value": " - - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 245, - 246, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 5, - "line": 8, - }, - }, - "range": Array [ - 246, - 255, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 14, - "line": 8, - }, - }, - "range": Array [ - 255, - 256, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 8, - }, - "start": Object { - "column": 15, - "line": 8, - }, - }, - "range": Array [ - 256, - 262, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 8, - }, - "start": Object { - "column": 21, - "line": 8, - }, - }, - "range": Array [ - 262, - 263, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 10, - }, - "start": Object { - "column": 4, - "line": 10, - }, - }, - "range": Array [ - 286, - 287, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 10, - }, - "start": Object { - "column": 5, - "line": 10, - }, - }, - "range": Array [ - 287, - 288, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 10, - }, - "start": Object { - "column": 6, - "line": 10, - }, - }, - "range": Array [ - 288, - 289, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 10, - }, - "start": Object { - "column": 7, - "line": 10, - }, - }, - "range": Array [ - 289, - 298, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 10, - }, - "start": Object { - "column": 16, - "line": 10, - }, - }, - "range": Array [ - 298, - 299, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 11, - }, - "start": Object { - "column": 17, - "line": 10, - }, - }, - "range": Array [ - 299, - 304, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "range": Array [ - 304, - 305, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 11, - }, - "start": Object { - "column": 5, - "line": 11, - }, - }, - "range": Array [ - 305, - 314, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 11, - }, - "start": Object { - "column": 14, - "line": 11, - }, - }, - "range": Array [ - 314, - 315, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 11, - }, - "start": Object { - "column": 15, - "line": 11, - }, - }, - "range": Array [ - 315, - 321, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 11, - }, - "start": Object { - "column": 21, - "line": 11, - }, - }, - "range": Array [ - 321, - 322, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 12, - }, - "start": Object { - "column": 6, - "line": 12, - }, - }, - "range": Array [ - 329, - 332, - ], - "type": "JSXIdentifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 14, - }, - "start": Object { - "column": 4, - "line": 14, - }, - }, - "range": Array [ - 355, - 356, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 14, - }, - "start": Object { - "column": 5, - "line": 14, - }, - }, - "range": Array [ - 356, - 357, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 14, - }, - "start": Object { - "column": 6, - "line": 14, - }, - }, - "range": Array [ - 357, - 358, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 14, - }, - "start": Object { - "column": 7, - "line": 14, - }, - }, - "range": Array [ - 358, - 367, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 14, - }, - "start": Object { - "column": 16, - "line": 14, - }, - }, - "range": Array [ - 367, - 368, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 15, - }, - "start": Object { - "column": 17, - "line": 14, - }, - }, - "range": Array [ - 368, - 373, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 15, - }, - "start": Object { - "column": 4, - "line": 15, - }, - }, - "range": Array [ - 373, - 374, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 15, - }, - "start": Object { - "column": 5, - "line": 15, - }, - }, - "range": Array [ - 374, - 383, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 15, - }, - "start": Object { - "column": 14, - "line": 15, - }, - }, - "range": Array [ - 383, - 384, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 15, - }, - "start": Object { - "column": 15, - "line": 15, - }, - }, - "range": Array [ - 384, - 390, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 15, - }, - "start": Object { - "column": 21, - "line": 15, - }, - }, - "range": Array [ - 390, - 391, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 17, - }, - "start": Object { - "column": 6, - "line": 17, - }, - }, - "range": Array [ - 416, - 419, - ], - "type": "JSXIdentifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 18, - }, - "start": Object { - "column": 4, - "line": 18, - }, - }, - "range": Array [ - 424, - 425, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 18, - }, - "start": Object { - "column": 5, - "line": 18, - }, - }, - "range": Array [ - 425, - 426, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 18, - }, - "start": Object { - "column": 6, - "line": 18, - }, - }, - "range": Array [ - 426, - 427, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 18, - }, - "start": Object { - "column": 7, - "line": 18, - }, - }, - "range": Array [ - 427, - 436, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 18, - }, - "start": Object { - "column": 16, - "line": 18, - }, - }, - "range": Array [ - 436, - 437, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 19, - }, - "start": Object { - "column": 17, - "line": 18, - }, - }, - "range": Array [ - 437, - 442, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 19, - }, - "start": Object { - "column": 4, - "line": 19, - }, - }, - "range": Array [ - 442, - 443, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 19, - }, - "start": Object { - "column": 5, - "line": 19, - }, - }, - "range": Array [ - 443, - 452, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 19, - }, - "start": Object { - "column": 14, - "line": 19, - }, - }, - "range": Array [ - 452, - 453, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 19, - }, - "start": Object { - "column": 15, - "line": 19, - }, - }, - "range": Array [ - 453, - 459, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 19, - }, - "start": Object { - "column": 21, - "line": 19, - }, - }, - "range": Array [ - 459, - 460, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 20, - }, - "start": Object { - "column": 6, - "line": 20, - }, - }, - "range": Array [ - 467, - 470, - ], - "type": "JSXIdentifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 22, - }, - "start": Object { - "column": 6, - "line": 22, - }, - }, - "range": Array [ - 495, - 498, - ], - "type": "JSXIdentifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 23, - }, - "start": Object { - "column": 4, - "line": 23, - }, - }, - "range": Array [ - 503, - 504, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 23, - }, - "start": Object { - "column": 5, - "line": 23, - }, - }, - "range": Array [ - 504, - 505, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 23, - }, - "start": Object { - "column": 6, - "line": 23, - }, - }, - "range": Array [ - 505, - 506, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 23, - }, - "start": Object { - "column": 7, - "line": 23, - }, - }, - "range": Array [ - 506, - 515, - ], - "type": "JSXIdentifier", - "value": "Component", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 23, - }, - "start": Object { - "column": 16, - "line": 23, - }, - }, - "range": Array [ - 515, - 516, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 24, - }, - "start": Object { - "column": 17, - "line": 23, - }, - }, - "range": Array [ - 516, - 519, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 24, - }, - "start": Object { - "column": 2, - "line": 24, - }, - }, - "range": Array [ - 519, - 520, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 24, - }, - "start": Object { - "column": 3, - "line": 24, - }, - }, - "range": Array [ - 520, - 521, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 24, - }, - "start": Object { - "column": 4, - "line": 24, - }, - }, - "range": Array [ - 521, - 522, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 25, - }, - "start": Object { - "column": 0, - "line": 25, - }, - }, - "range": Array [ - 523, - 524, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 25, - }, - "start": Object { - "column": 1, - "line": 25, - }, - }, - "range": Array [ - 524, - 525, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-tag-comment-after-prop.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "pure", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "children": Array [], - "closingElement": null, - "loc": Object { - "end": Object { - "column": 8, - "line": 8, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "name": "foo", - "range": Array [ - 66, - 69, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 66, - 75, - ], - "type": "JSXAttribute", - "value": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 5, - }, - }, - "range": Array [ - 71, - 74, - ], - "raw": "123", - "type": "Literal", - "value": 123, - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 70, - 75, - ], - "type": "JSXExpressionContainer", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "name": "bar", - "range": Array [ - 99, - 102, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 99, - 109, - ], - "type": "JSXAttribute", - "value": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "range": Array [ - 103, - 109, - ], - "raw": "\\"woof\\"", - "type": "Literal", - "value": "woof", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 8, - "line": 8, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "name": "Foo", - "range": Array [ - 39, - 42, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 38, - 118, - ], - "selfClosing": true, - "type": "JSXOpeningElement", - }, - "range": Array [ - 38, - 118, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 4, - "line": 9, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 23, - 123, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 125, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 13, - 125, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 125, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 125, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 51, - 57, - ], - "type": "Line", - "value": " one", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 84, - 90, - ], - "type": "Line", - "value": " two", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 12, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 127, - ], - "sourceType": "module", - "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": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - "value": "pure", - }, - 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": 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": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "Punctuator", - "value": "=>", - }, - 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": 8, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 23, - 29, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "range": Array [ - 39, - 42, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 66, - 69, - ], - "type": "JSXIdentifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 5, - }, - }, - "range": Array [ - 69, - 70, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 70, - 71, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 5, - }, - }, - "range": Array [ - 71, - 74, - ], - "type": "Numeric", - "value": "123", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 5, - }, - }, - "range": Array [ - 74, - 75, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 99, - 102, - ], - "type": "JSXIdentifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 11, - "line": 7, - }, - }, - "range": Array [ - 102, - 103, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "range": Array [ - 103, - 109, - ], - "type": "JSXText", - "value": "\\"woof\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 6, - "line": 8, - }, - }, - "range": Array [ - 116, - 117, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 8, - }, - "start": Object { - "column": 7, - "line": 8, - }, - }, - "range": Array [ - 117, - 118, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 9, - }, - "start": Object { - "column": 2, - "line": 9, - }, - }, - "range": Array [ - 121, - 122, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 9, - }, - "start": Object { - "column": 3, - "line": 9, - }, - }, - "range": Array [ - 122, - 123, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 10, - }, - }, - "range": Array [ - 124, - 125, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-tag-comments.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "pure", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 103, - 112, - ], - "raw": " - ", - "type": "JSXText", - "value": " - ", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "name": "Foo", - "range": Array [ - 114, - 117, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 112, - 118, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 9, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "Foo", - "range": Array [ - 43, - 46, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 42, - 103, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 42, - 118, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 125, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 127, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 13, - 127, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 127, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 127, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "range": Array [ - 59, - 68, - ], - "type": "Line", - "value": " single", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 81, - 92, - ], - "type": "Block", - "value": " block ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 11, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 129, - ], - "sourceType": "module", - "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": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - "value": "pure", - }, - 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": 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": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "Punctuator", - "value": "=>", - }, - 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": 10, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 31, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 102, - 103, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 103, - 112, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 112, - 113, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "range": Array [ - 113, - 114, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 114, - 117, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 13, - "line": 7, - }, - }, - "range": Array [ - 117, - 118, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 123, - 124, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 8, - }, - "start": Object { - "column": 5, - "line": 8, - }, - }, - "range": Array [ - 124, - 125, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 126, - 127, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-text-with-multiline-non-comment.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "pure", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 41, - 80, - ], - "raw": " - /** - * test - */ - ", - "type": "JSXText", - "value": " - /** - * test - */ - ", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "name": "Foo", - "range": Array [ - 82, - 85, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 80, - 86, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "name": "Foo", - "range": Array [ - 37, - 40, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 36, - 41, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 36, - 86, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 4, - "line": 8, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 23, - 91, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 93, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 13, - 93, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 93, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 93, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 94, - ], - "sourceType": "module", - "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": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - "value": "pure", - }, - 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": 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": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "Punctuator", - "value": "=>", - }, - 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": 8, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 23, - 29, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "range": Array [ - 37, - 40, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 41, - 80, - ], - "type": "JSXText", - "value": " - /** - * test - */ - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "range": Array [ - 80, - 81, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 7, - }, - "start": Object { - "column": 5, - "line": 7, - }, - }, - "range": Array [ - 81, - 82, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "range": Array [ - 82, - 85, - ], - "type": "JSXIdentifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "range": Array [ - 85, - 86, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 8, - }, - "start": Object { - "column": 2, - "line": 8, - }, - }, - "range": Array [ - 89, - 90, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 8, - }, - "start": Object { - "column": 3, - "line": 8, - }, - }, - "range": Array [ - 90, - 91, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 92, - 93, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-text-with-url.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "first", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 37, - ], - "raw": "http://example.com", - "type": "JSXText", - "value": "http://example.com", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 37, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "name": "div", - "range": Array [ - 39, - 42, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 37, - 43, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "div", - "range": Array [ - 15, - 18, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 14, - 19, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 14, - 43, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 43, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 44, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "second", - "range": Array [ - 52, - 58, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 3, - }, - "start": Object { - "column": 17, - "line": 3, - }, - }, - "range": Array [ - 63, - 81, - ], - "raw": "http://example.com", - "type": "JSXText", - "value": "http://example.com", - }, - ], - "closingFragment": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 3, - }, - "start": Object { - "column": 35, - "line": 3, - }, - }, - "range": Array [ - 81, - 84, - ], - "type": "JSXClosingFragment", - }, - "loc": Object { - "end": Object { - "column": 38, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "openingFragment": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 61, - 63, - ], - "type": "JSXOpeningFragment", - }, - "range": Array [ - 61, - 84, - ], - "type": "JSXFragment", - }, - "loc": Object { - "end": Object { - "column": 38, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 52, - 84, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 46, - 85, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "name": "third", - "range": Array [ - 93, - 98, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "children": Array [], - "closingElement": null, - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 19, - "line": 5, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 19, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 5, - }, - "start": Object { - "column": 20, - "line": 5, - }, - }, - "name": "br", - "range": Array [ - 107, - 109, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 106, - 112, - ], - "selfClosing": true, - "type": "JSXOpeningElement", - }, - "range": Array [ - 106, - 112, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 5, - }, - "start": Object { - "column": 25, - "line": 5, - }, - }, - "range": Array [ - 112, - 130, - ], - "raw": "http://example.com", - "type": "JSXText", - "value": "http://example.com", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 49, - "line": 5, - }, - "start": Object { - "column": 43, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 5, - }, - "start": Object { - "column": 45, - "line": 5, - }, - }, - "name": "div", - "range": Array [ - 132, - 135, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 130, - 136, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 49, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 5, - }, - "start": Object { - "column": 15, - "line": 5, - }, - }, - "name": "div", - "range": Array [ - 102, - 105, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 101, - 106, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 101, - 136, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 49, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "range": Array [ - 93, - 136, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 50, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 87, - 137, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "name": "fourth", - "range": Array [ - 145, - 151, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "children": Array [], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 7, - }, - "start": Object { - "column": 26, - "line": 7, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 7, - }, - "start": Object { - "column": 28, - "line": 7, - }, - }, - "name": "span", - "range": Array [ - 167, - 171, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 165, - 172, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 7, - }, - "start": Object { - "column": 20, - "line": 7, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 7, - }, - "start": Object { - "column": 20, - "line": 7, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 7, - }, - "start": Object { - "column": 21, - "line": 7, - }, - }, - "name": "span", - "range": Array [ - 160, - 164, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 159, - 165, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 159, - 172, - ], - "type": "JSXElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 51, - "line": 7, - }, - "start": Object { - "column": 33, - "line": 7, - }, - }, - "range": Array [ - 172, - 190, - ], - "raw": "http://example.com", - "type": "JSXText", - "value": "http://example.com", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 7, - }, - "start": Object { - "column": 51, - "line": 7, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 7, - }, - "start": Object { - "column": 53, - "line": 7, - }, - }, - "name": "div", - "range": Array [ - 192, - 195, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 190, - 196, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 57, - "line": 7, - }, - "start": Object { - "column": 15, - "line": 7, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 15, - "line": 7, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 7, - }, - "start": Object { - "column": 16, - "line": 7, - }, - }, - "name": "div", - "range": Array [ - 155, - 158, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 154, - 159, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 154, - 196, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 57, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "range": Array [ - 145, - 196, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 58, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 139, - 197, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 9, - }, - "start": Object { - "column": 6, - "line": 9, - }, - }, - "name": "fifth", - "range": Array [ - 205, - 210, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 9, - }, - "start": Object { - "column": 20, - "line": 9, - }, - }, - "range": Array [ - 219, - 219, - ], - "type": "JSXEmptyExpression", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 9, - }, - "start": Object { - "column": 19, - "line": 9, - }, - }, - "range": Array [ - 218, - 220, - ], - "type": "JSXExpressionContainer", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 9, - }, - "start": Object { - "column": 21, - "line": 9, - }, - }, - "range": Array [ - 220, - 238, - ], - "raw": "http://example.com", - "type": "JSXText", - "value": "http://example.com", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 9, - }, - "start": Object { - "column": 39, - "line": 9, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 9, - }, - "start": Object { - "column": 41, - "line": 9, - }, - }, - "name": "div", - "range": Array [ - 240, - 243, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 238, - 244, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 45, - "line": 9, - }, - "start": Object { - "column": 14, - "line": 9, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 19, - "line": 9, - }, - "start": Object { - "column": 14, - "line": 9, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 9, - }, - "start": Object { - "column": 15, - "line": 9, - }, - }, - "name": "div", - "range": Array [ - 214, - 217, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 213, - 218, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 213, - 244, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 45, - "line": 9, - }, - "start": Object { - "column": 6, - "line": 9, - }, - }, - "range": Array [ - 205, - 244, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 46, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 199, - 245, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 246, - ], - "sourceType": "module", - "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": 11, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - "value": "first", - }, - 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": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "JSXIdentifier", - "value": "div", - }, - 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": 37, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 37, - ], - "type": "JSXText", - "value": "http://example.com", - }, - 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": 42, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 42, - ], - "type": "JSXIdentifier", - "value": "div", - }, - 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": 5, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 46, - 51, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 52, - 58, - ], - "type": "Identifier", - "value": "second", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 59, - 60, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 61, - 62, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 3, - }, - "start": Object { - "column": 17, - "line": 3, - }, - }, - "range": Array [ - 63, - 81, - ], - "type": "JSXText", - "value": "http://example.com", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 3, - }, - "start": Object { - "column": 35, - "line": 3, - }, - }, - "range": Array [ - 81, - 82, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 3, - }, - "start": Object { - "column": 36, - "line": 3, - }, - }, - "range": Array [ - 82, - 83, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 3, - }, - "start": Object { - "column": 37, - "line": 3, - }, - }, - "range": Array [ - 83, - 84, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 38, - "line": 3, - }, - }, - "range": Array [ - 84, - 85, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 87, - 92, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "range": Array [ - 93, - 98, - ], - "type": "Identifier", - "value": "third", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 99, - 100, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "range": Array [ - 101, - 102, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 5, - }, - "start": Object { - "column": 15, - "line": 5, - }, - }, - "range": Array [ - 102, - 105, - ], - "type": "JSXIdentifier", - "value": "div", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 18, - "line": 5, - }, - }, - "range": Array [ - 105, - 106, - ], - "type": "Punctuator", - "value": ">", - }, - 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": 22, - "line": 5, - }, - "start": Object { - "column": 20, - "line": 5, - }, - }, - "range": Array [ - 107, - 109, - ], - "type": "JSXIdentifier", - "value": "br", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 5, - }, - "start": Object { - "column": 23, - "line": 5, - }, - }, - "range": Array [ - 110, - 111, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 24, - "line": 5, - }, - }, - "range": Array [ - 111, - 112, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 5, - }, - "start": Object { - "column": 25, - "line": 5, - }, - }, - "range": Array [ - 112, - 130, - ], - "type": "JSXText", - "value": "http://example.com", - }, - Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 5, - }, - "start": Object { - "column": 43, - "line": 5, - }, - }, - "range": Array [ - 130, - 131, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 5, - }, - "start": Object { - "column": 44, - "line": 5, - }, - }, - "range": Array [ - 131, - 132, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 5, - }, - "start": Object { - "column": 45, - "line": 5, - }, - }, - "range": Array [ - 132, - 135, - ], - "type": "JSXIdentifier", - "value": "div", - }, - Object { - "loc": Object { - "end": Object { - "column": 49, - "line": 5, - }, - "start": Object { - "column": 48, - "line": 5, - }, - }, - "range": Array [ - 135, - 136, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 5, - }, - "start": Object { - "column": 49, - "line": 5, - }, - }, - "range": Array [ - 136, - 137, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 139, - 144, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "range": Array [ - 145, - 151, - ], - "type": "Identifier", - "value": "fourth", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 13, - "line": 7, - }, - }, - "range": Array [ - 152, - 153, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 7, - }, - "start": Object { - "column": 15, - "line": 7, - }, - }, - "range": Array [ - 154, - 155, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 7, - }, - "start": Object { - "column": 16, - "line": 7, - }, - }, - "range": Array [ - 155, - 158, - ], - "type": "JSXIdentifier", - "value": "div", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 19, - "line": 7, - }, - }, - "range": Array [ - 158, - 159, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 7, - }, - "start": Object { - "column": 20, - "line": 7, - }, - }, - "range": Array [ - 159, - 160, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 7, - }, - "start": Object { - "column": 21, - "line": 7, - }, - }, - "range": Array [ - 160, - 164, - ], - "type": "JSXIdentifier", - "value": "span", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 7, - }, - "start": Object { - "column": 25, - "line": 7, - }, - }, - "range": Array [ - 164, - 165, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 7, - }, - "start": Object { - "column": 26, - "line": 7, - }, - }, - "range": Array [ - 165, - 166, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 7, - }, - "start": Object { - "column": 27, - "line": 7, - }, - }, - "range": Array [ - 166, - 167, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 7, - }, - "start": Object { - "column": 28, - "line": 7, - }, - }, - "range": Array [ - 167, - 171, - ], - "type": "JSXIdentifier", - "value": "span", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 7, - }, - "start": Object { - "column": 32, - "line": 7, - }, - }, - "range": Array [ - 171, - 172, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 51, - "line": 7, - }, - "start": Object { - "column": 33, - "line": 7, - }, - }, - "range": Array [ - 172, - 190, - ], - "type": "JSXText", - "value": "http://example.com", - }, - Object { - "loc": Object { - "end": Object { - "column": 52, - "line": 7, - }, - "start": Object { - "column": 51, - "line": 7, - }, - }, - "range": Array [ - 190, - 191, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 7, - }, - "start": Object { - "column": 52, - "line": 7, - }, - }, - "range": Array [ - 191, - 192, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 7, - }, - "start": Object { - "column": 53, - "line": 7, - }, - }, - "range": Array [ - 192, - 195, - ], - "type": "JSXIdentifier", - "value": "div", - }, - Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 7, - }, - "start": Object { - "column": 56, - "line": 7, - }, - }, - "range": Array [ - 195, - 196, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 7, - }, - "start": Object { - "column": 57, - "line": 7, - }, - }, - "range": Array [ - 196, - 197, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 199, - 204, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 9, - }, - "start": Object { - "column": 6, - "line": 9, - }, - }, - "range": Array [ - 205, - 210, - ], - "type": "Identifier", - "value": "fifth", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 9, - }, - "start": Object { - "column": 12, - "line": 9, - }, - }, - "range": Array [ - 211, - 212, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 9, - }, - "start": Object { - "column": 14, - "line": 9, - }, - }, - "range": Array [ - 213, - 214, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 9, - }, - "start": Object { - "column": 15, - "line": 9, - }, - }, - "range": Array [ - 214, - 217, - ], - "type": "JSXIdentifier", - "value": "div", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 9, - }, - "start": Object { - "column": 18, - "line": 9, - }, - }, - "range": Array [ - 217, - 218, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 9, - }, - "start": Object { - "column": 19, - "line": 9, - }, - }, - "range": Array [ - 218, - 219, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 9, - }, - "start": Object { - "column": 20, - "line": 9, - }, - }, - "range": Array [ - 219, - 220, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 9, - }, - "start": Object { - "column": 21, - "line": 9, - }, - }, - "range": Array [ - 220, - 238, - ], - "type": "JSXText", - "value": "http://example.com", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 9, - }, - "start": Object { - "column": 39, - "line": 9, - }, - }, - "range": Array [ - 238, - 239, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 40, - "line": 9, - }, - }, - "range": Array [ - 239, - 240, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 9, - }, - "start": Object { - "column": 41, - "line": 9, - }, - }, - "range": Array [ - 240, - 243, - ], - "type": "JSXIdentifier", - "value": "div", - }, - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 9, - }, - "start": Object { - "column": 44, - "line": 9, - }, - }, - "range": Array [ - 243, - 244, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 9, - }, - "start": Object { - "column": 45, - "line": 9, - }, - }, - "range": Array [ - 244, - 245, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-with-greather-than.src 1`] = ` -Object { - "body": Array [ - Object { - "alternate": null, - "consequent": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "operator": ">>", - "range": Array [ - 30, - 36, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 35, - 36, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "type": "BinaryExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "test", - "range": Array [ - 24, - 28, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "optional": false, - "range": Array [ - 24, - 37, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 24, - 38, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 3, - }, - }, - "range": Array [ - 59, - 61, - ], - "raw": "//", - "type": "JSXText", - "value": "//", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "name": "test", - "range": Array [ - 63, - 67, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 61, - 68, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "test", - "range": Array [ - 54, - 58, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 53, - 59, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 53, - 68, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 47, - 68, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 41, - 68, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 70, - ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 70, - ], - "test": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "operator": ">", - "range": Array [ - 4, - 18, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "type": "BinaryExpression", - }, - "type": "IfStatement", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 17, - ], - "type": "Block", - "value": " Test ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 71, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 2, - ], - "type": "Keyword", - "value": "if", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 4, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Numeric", - "value": "1", - }, - 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": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Numeric", - "value": "2", - }, - 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": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 24, - 28, - ], - "type": "Identifier", - "value": "test", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 32, - 34, - ], - "type": "Punctuator", - "value": ">>", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Numeric", - "value": "3", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": ")", - }, - 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": 7, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 41, - 46, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 51, - 52, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 54, - 58, - ], - "type": "JSXIdentifier", - "value": "test", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 3, - }, - }, - "range": Array [ - 58, - 59, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 3, - }, - }, - "range": Array [ - 59, - 61, - ], - "type": "JSXText", - "value": "//", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 3, - }, - }, - "range": Array [ - 61, - 62, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 3, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "range": Array [ - 63, - 67, - ], - "type": "JSXIdentifier", - "value": "test", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 3, - }, - }, - "range": Array [ - 67, - 68, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 69, - 70, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/jsx-with-operators.src 1`] = ` -Object { - "body": Array [ - Object { - "alternate": null, - "consequent": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "operator": ">>", - "range": Array [ - 30, - 36, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 35, - 36, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "type": "BinaryExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "test", - "range": Array [ - 24, - 28, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "optional": false, - "range": Array [ - 24, - 37, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 24, - 38, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "init": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 3, - }, - }, - "range": Array [ - 59, - 61, - ], - "raw": "//", - "type": "JSXText", - "value": "//", - }, - ], - "closingElement": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "name": "test", - "range": Array [ - 63, - 67, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 61, - 68, - ], - "type": "JSXClosingElement", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "test", - "range": Array [ - 54, - 58, - ], - "type": "JSXIdentifier", - }, - "range": Array [ - 53, - 59, - ], - "selfClosing": false, - "type": "JSXOpeningElement", - }, - "range": Array [ - 53, - 68, - ], - "type": "JSXElement", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 47, - 68, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 41, - 68, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 70, - ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 70, - ], - "test": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "operator": "<", - "range": Array [ - 4, - 18, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "type": "BinaryExpression", - }, - "type": "IfStatement", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 17, - ], - "type": "Block", - "value": " Test ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 71, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 2, - ], - "type": "Keyword", - "value": "if", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 4, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Numeric", - "value": "1", - }, - 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": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Numeric", - "value": "2", - }, - 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": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 24, - 28, - ], - "type": "Identifier", - "value": "test", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 32, - 34, - ], - "type": "Punctuator", - "value": ">>", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Numeric", - "value": "3", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": ")", - }, - 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": 7, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 41, - 46, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 51, - 52, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 54, - 58, - ], - "type": "JSXIdentifier", - "value": "test", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 3, - }, - }, - "range": Array [ - 58, - 59, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 3, - }, - }, - "range": Array [ - 59, - 61, - ], - "type": "JSXText", - "value": "//", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 3, - }, - }, - "range": Array [ - 61, - 62, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 3, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": "/", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "range": Array [ - 63, - 67, - ], - "type": "JSXIdentifier", - "value": "test", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 3, - }, - }, - "range": Array [ - 67, - 68, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 69, - 70, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/line-comment-with-block-syntax.src 1`] = ` -Object { - "body": Array [], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 11, - ], - "type": "Line", - "value": " /*test*/", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 12, - 12, - ], - "sourceType": "module", - "tokens": Array [], - "type": "Program", -} -`; - -exports[`Comments fixtures/mix-line-and-block-comments.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "zzz", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 24, - 27, - ], - "raw": "777", - "type": "Literal", - "value": 777, - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 10, - 27, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 6, - 28, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Line", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 14, - 21, - ], - "type": "Block", - "value": "aaa", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 29, - 34, - ], - "type": "Line", - "value": "bar", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 6, - 35, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 6, - 9, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - "value": "zzz", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 24, - 27, - ], - "type": "Numeric", - "value": "777", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/no-comment-regex.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "regex", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 33, - ], - "raw": "/no comment\\\\/**foo/", - "regex": Object { - "flags": "", - "pattern": "no comment\\\\/**foo", - }, - "type": "Literal", - "value": null, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 33, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 35, - ], - "sourceType": "module", - "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": 11, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - "value": "regex", - }, - 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": 33, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 33, - ], - "regex": Object { - "flags": "", - "pattern": "no comment\\\\/**foo", - }, - "type": "RegularExpression", - "value": "/no comment\\\\/**foo/", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/no-comment-template.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": "str", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "init": Object { - "expressions": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "__dirname", - "range": Array [ - 15, - 24, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "quasis": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 15, - ], - "tail": false, - "type": "TemplateElement", - "value": Object { - "cooked": "", - "raw": "", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 36, - ], - "tail": true, - "type": "TemplateElement", - "value": Object { - "cooked": "/test/*.js", - "raw": "/test/*.js", - }, - }, - ], - "range": Array [ - 12, - 36, - ], - "type": "TemplateLiteral", - }, - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 36, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 37, - ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 38, - ], - "sourceType": "module", - "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": "str", - }, - 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": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 15, - ], - "type": "Template", - "value": "\`\${", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 24, - ], - "type": "Identifier", - "value": "__dirname", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 36, - ], - "type": "Template", - "value": "}/test/*.js\`", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/surrounding-call-comments.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "optional": false, - "range": Array [ - 36, - 41, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 36, - 42, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 60, - ], - "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": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 0, - 60, - ], - "type": "FunctionDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 19, - 31, - ], - "type": "Block", - "value": " before ", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 47, - 58, - ], - "type": "Block", - "value": " after ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 61, - ], - "sourceType": "module", - "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 { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "a", - }, - 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": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "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": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 41, - 42, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 59, - 60, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/surrounding-debugger-comments.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 36, - 45, - ], - "type": "DebuggerStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 63, - ], - "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": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 0, - 63, - ], - "type": "FunctionDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 19, - 31, - ], - "type": "Block", - "value": " before ", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 50, - 61, - ], - "type": "Block", - "value": " after ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 64, - ], - "sourceType": "module", - "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 { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "a", - }, - 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": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "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": 12, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 36, - 44, - ], - "type": "Keyword", - "value": "debugger", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/surrounding-return-comments.src 1`] = ` -Object { - "body": Array [ - 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 [ - 36, - 43, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 61, - ], - "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": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 19, - 31, - ], - "type": "Block", - "value": " before ", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 48, - 59, - ], - "type": "Block", - "value": " after ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 62, - ], - "sourceType": "module", - "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 { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "a", - }, - 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": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "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": 10, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 36, - 42, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 60, - 61, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/surrounding-throw-comments.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 42, - 44, - ], - "raw": "55", - "type": "Literal", - "value": 55, - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 36, - 45, - ], - "type": "ThrowStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 63, - ], - "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": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 0, - 63, - ], - "type": "FunctionDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 19, - 31, - ], - "type": "Block", - "value": " before ", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 50, - 61, - ], - "type": "Block", - "value": " after ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 64, - ], - "sourceType": "module", - "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 { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "a", - }, - 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": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "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": 9, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 36, - 41, - ], - "type": "Keyword", - "value": "throw", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 42, - 44, - ], - "type": "Numeric", - "value": "55", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/surrounding-while-loop-comments.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 43, - "line": 1, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 46, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 37, - "line": 1, - }, - }, - "range": Array [ - 37, - 41, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, - "type": "WhileStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 65, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, - }, - "name": "each", - "range": Array [ - 61, - 65, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 65, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, - }, - "range": Array [ - 61, - 65, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 66, - "line": 1, - }, - "start": Object { - "column": 57, - "line": 1, - }, - }, - "range": Array [ - 57, - 66, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 68, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 68, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 68, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 0, - 68, - ], - "type": "FunctionDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 29, - ], - "type": "Block", - "value": " infinite ", - }, - Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 47, - "line": 1, - }, - }, - "range": Array [ - 47, - 56, - ], - "type": "Block", - "value": " bar ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 69, - ], - "sourceType": "module", - "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 { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "f", - }, - 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": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "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": 35, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 35, - ], - "type": "Keyword", - "value": "while", - }, - 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": 37, - "line": 1, - }, - }, - "range": Array [ - 37, - 41, - ], - "type": "Boolean", - "value": "true", - }, - 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": 46, - "line": 1, - }, - "start": Object { - "column": 45, - "line": 1, - }, - }, - "range": Array [ - 45, - 46, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 60, - "line": 1, - }, - "start": Object { - "column": 57, - "line": 1, - }, - }, - "range": Array [ - 57, - 60, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 65, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, - }, - "range": Array [ - 61, - 65, - ], - "type": "Identifier", - "value": "each", - }, - Object { - "loc": Object { - "end": Object { - "column": 66, - "line": 1, - }, - "start": Object { - "column": 65, - "line": 1, - }, - }, - "range": Array [ - 65, - 66, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 68, - "line": 1, - }, - "start": Object { - "column": 67, - "line": 1, - }, - }, - "range": Array [ - 67, - 68, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/switch-fallthrough-comment.src 1`] = ` -Object { - "body": Array [ - Object { - "cases": Array [ - Object { - "consequent": Array [], - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 29, - 36, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 34, - 35, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "SwitchCase", - }, - Object { - "consequent": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "name": "doIt", - "range": Array [ - 82, - 86, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "optional": false, - "range": Array [ - 82, - 88, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 82, - 89, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 66, - 89, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 5, - }, - "start": Object { - "column": 9, - "line": 5, - }, - }, - "range": Array [ - 71, - 72, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "type": "SwitchCase", - }, - ], - "discriminant": 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": 7, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 91, - ], - "type": "SwitchStatement", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 18, - 24, - ], - "type": "Line", - "value": " foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 45, - 61, - ], - "type": "Line", - "value": " falls through", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 92, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "switch", - }, - 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": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 10, - ], - "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": 8, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 29, - 33, - ], - "type": "Keyword", - "value": "case", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 34, - 35, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 66, - 70, - ], - "type": "Keyword", - "value": "case", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 5, - }, - "start": Object { - "column": 9, - "line": 5, - }, - }, - "range": Array [ - 71, - 72, - ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 5, - }, - "start": Object { - "column": 10, - "line": 5, - }, - }, - "range": Array [ - 72, - 73, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 82, - 86, - ], - "type": "Identifier", - "value": "doIt", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 6, - }, - }, - "range": Array [ - 86, - 87, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 6, - }, - }, - "range": Array [ - 87, - 88, - ], - "type": "Punctuator", - "value": ")", - }, - 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": 1, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 90, - 91, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/switch-fallthrough-comment-in-function.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "cases": Array [ - Object { - "consequent": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 61, - 68, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 4, - }, - }, - "range": Array [ - 66, - 67, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "SwitchCase", - }, - Object { - "consequent": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "name": "doIt", - "range": Array [ - 126, - 130, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "optional": false, - "range": Array [ - 126, - 132, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "range": Array [ - 126, - 133, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 19, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 106, - 133, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 6, - }, - }, - "range": Array [ - 111, - 112, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "type": "SwitchCase", - }, - ], - "discriminant": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 24, - 139, - ], - "type": "SwitchStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 141, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 0, - 141, - ], - "type": "FunctionDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 46, - 52, - ], - "type": "Line", - "value": " foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 81, - 97, - ], - "type": "Line", - "value": " falls through", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 142, - ], - "sourceType": "module", - "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": "bar", - }, - 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": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - "value": "foo", - }, - 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": 10, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 24, - 30, - ], - "type": "Keyword", - "value": "switch", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 34, - 35, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 61, - 65, - ], - "type": "Keyword", - "value": "case", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 4, - }, - }, - "range": Array [ - 66, - 67, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "range": Array [ - 67, - 68, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 106, - 110, - ], - "type": "Keyword", - "value": "case", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 6, - }, - }, - "range": Array [ - 111, - 112, - ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 6, - }, - "start": Object { - "column": 14, - "line": 6, - }, - }, - "range": Array [ - 112, - 113, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "range": Array [ - 126, - 130, - ], - "type": "Identifier", - "value": "doIt", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 7, - }, - "start": Object { - "column": 16, - "line": 7, - }, - }, - "range": Array [ - 130, - 131, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 7, - }, - "start": Object { - "column": 17, - "line": 7, - }, - }, - "range": Array [ - 131, - 132, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 7, - }, - "start": Object { - "column": 18, - "line": 7, - }, - }, - "range": Array [ - 132, - 133, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 138, - 139, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 140, - 141, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/switch-no-default-comment.src 1`] = ` -Object { - "body": Array [ - Object { - "cases": Array [ - Object { - "consequent": Array [ - Object { - "label": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 33, - 39, - ], - "type": "BreakStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 39, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "SwitchCase", - }, - ], - "discriminant": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 58, - ], - "type": "SwitchStatement", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 44, - 56, - ], - "type": "Line", - "value": "no default", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 59, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "switch", - }, - 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": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "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": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 21, - ], - "type": "Keyword", - "value": "case", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 33, - 38, - ], - "type": "Keyword", - "value": "break", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/switch-no-default-comment-in-function.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "cases": Array [ - Object { - "consequent": Array [ - Object { - "label": null, - "loc": Object { - "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "range": Array [ - 63, - 69, - ], - "type": "BreakStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 43, - 69, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 48, - 49, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "type": "SwitchCase", - }, - Object { - "consequent": Array [ - Object { - "label": null, - "loc": Object { - "end": Object { - "column": 18, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 6, - }, - }, - "range": Array [ - 98, - 104, - ], - "type": "BreakStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 18, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 78, - 104, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 5, - }, - }, - "range": Array [ - 83, - 84, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "SwitchCase", - }, - ], - "discriminant": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 22, - 131, - ], - "type": "SwitchStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 133, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 0, - 133, - ], - "type": "FunctionDeclaration", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 113, - 125, - ], - "type": "Line", - "value": "no default", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 134, - ], - "sourceType": "module", - "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": "bar", - }, - 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": "Identifier", - "value": "a", - }, - 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": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 22, - 28, - ], - "type": "Keyword", - "value": "switch", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 43, - 47, - ], - "type": "Keyword", - "value": "case", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 48, - 49, - ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 49, - 50, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "range": Array [ - 63, - 68, - ], - "type": "Keyword", - "value": "break", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, - }, - }, - "range": Array [ - 68, - 69, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 78, - 82, - ], - "type": "Keyword", - "value": "case", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 5, - }, - }, - "range": Array [ - 83, - 84, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "range": Array [ - 84, - 85, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 6, - }, - }, - "range": Array [ - 98, - 103, - ], - "type": "Keyword", - "value": "break", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 6, - }, - "start": Object { - "column": 17, - "line": 6, - }, - }, - "range": Array [ - 103, - 104, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 130, - 131, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 132, - 133, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/switch-no-default-comment-in-nested-functions.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "module", - "range": Array [ - 0, - 6, - ], - "type": "Identifier", - }, - "optional": false, - "property": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "exports", - "range": Array [ - 7, - 14, - ], - "type": "Identifier", - }, - "range": Array [ - 0, - 14, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 12, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 286, - ], - "right": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "cases": Array [ - Object { - "consequent": Array [ - Object { - "argument": Object { - "arguments": Array [ - Object { - "computed": true, - "loc": Object { - "end": Object { - "column": 79, - "line": 6, - }, - "start": Object { - "column": 34, - "line": 6, - }, - }, - "object": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 50, - "line": 6, - }, - "start": Object { - "column": 34, - "line": 6, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 6, - }, - "start": Object { - "column": 34, - "line": 6, - }, - }, - "name": "node", - "range": Array [ - 172, - 176, - ], - "type": "Identifier", - }, - "optional": false, - "property": Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 6, - }, - "start": Object { - "column": 39, - "line": 6, - }, - }, - "name": "expressions", - "range": Array [ - 177, - 188, - ], - "type": "Identifier", - }, - "range": Array [ - 172, - 188, - ], - "type": "MemberExpression", - }, - "optional": false, - "property": Object { - "left": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 74, - "line": 6, - }, - "start": Object { - "column": 51, - "line": 6, - }, - }, - "object": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 67, - "line": 6, - }, - "start": Object { - "column": 51, - "line": 6, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 6, - }, - "start": Object { - "column": 51, - "line": 6, - }, - }, - "name": "node", - "range": Array [ - 189, - 193, - ], - "type": "Identifier", - }, - "optional": false, - "property": Object { - "loc": Object { - "end": Object { - "column": 67, - "line": 6, - }, - "start": Object { - "column": 56, - "line": 6, - }, - }, - "name": "expressions", - "range": Array [ - 194, - 205, - ], - "type": "Identifier", - }, - "range": Array [ - 189, - 205, - ], - "type": "MemberExpression", - }, - "optional": false, - "property": Object { - "loc": Object { - "end": Object { - "column": 74, - "line": 6, - }, - "start": Object { - "column": 68, - "line": 6, - }, - }, - "name": "length", - "range": Array [ - 206, - 212, - ], - "type": "Identifier", - }, - "range": Array [ - 189, - 212, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 78, - "line": 6, - }, - "start": Object { - "column": 51, - "line": 6, - }, - }, - "operator": "-", - "range": Array [ - 189, - 216, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 78, - "line": 6, - }, - "start": Object { - "column": 77, - "line": 6, - }, - }, - "range": Array [ - 215, - 216, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "BinaryExpression", - }, - "range": Array [ - 172, - 217, - ], - "type": "MemberExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 6, - }, - "start": Object { - "column": 23, - "line": 6, - }, - }, - "name": "isConstant", - "range": Array [ - 161, - 171, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 80, - "line": 6, - }, - "start": Object { - "column": 23, - "line": 6, - }, - }, - "optional": false, - "range": Array [ - 161, - 218, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 81, - "line": 6, - }, - "start": Object { - "column": 16, - "line": 6, - }, - }, - "range": Array [ - 154, - 219, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 81, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 111, - 219, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "range": Array [ - 116, - 136, - ], - "raw": "\\"SequenceExpression\\"", - "type": "Literal", - "value": "SequenceExpression", - }, - "type": "SwitchCase", - }, - ], - "discriminant": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 25, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 4, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 4, - }, - }, - "name": "node", - "range": Array [ - 86, - 90, - ], - "type": "Identifier", - }, - "optional": false, - "property": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "name": "type", - "range": Array [ - 91, - 95, - ], - "type": "Identifier", - }, - "range": Array [ - 86, - 95, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 8, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 78, - 255, - ], - "type": "SwitchStatement", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 9, - }, - "start": Object { - "column": 15, - "line": 9, - }, - }, - "range": Array [ - 271, - 276, - ], - "raw": "false", - "type": "Literal", - "value": false, - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 9, - }, - }, - "range": Array [ - 264, - 277, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 10, - }, - "start": Object { - "column": 30, - "line": 3, - }, - }, - "range": Array [ - 68, - 283, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "name": "isConstant", - "range": Array [ - 51, - 61, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 10, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "name": "node", - "range": Array [ - 62, - 66, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 42, - 283, - ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 12, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 286, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 12, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "context", - "range": Array [ - 26, - 33, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 17, - 286, - ], - "type": "FunctionExpression", - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 2, - "line": 12, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 287, - ], - "type": "ExpressionStatement", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "range": Array [ - 232, - 245, - ], - "type": "Line", - "value": " no default", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 13, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 288, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Identifier", - "value": "module", - }, - 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": 14, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 14, - ], - "type": "Identifier", - "value": "exports", - }, - 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": 25, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 25, - ], - "type": "Keyword", - "value": "function", - }, - 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": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 33, - ], - "type": "Identifier", - "value": "context", - }, - 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": 12, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 42, - 50, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 51, - 61, - ], - "type": "Identifier", - "value": "isConstant", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 3, - }, - }, - "range": Array [ - 61, - 62, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "range": Array [ - 62, - 66, - ], - "type": "Identifier", - "value": "node", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 3, - }, - }, - "range": Array [ - 66, - 67, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 3, - }, - "start": Object { - "column": 30, - "line": 3, - }, - }, - "range": Array [ - 68, - 69, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 78, - 84, - ], - "type": "Keyword", - "value": "switch", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 4, - }, - }, - "range": Array [ - 85, - 86, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 4, - }, - }, - "range": Array [ - 86, - 90, - ], - "type": "Identifier", - "value": "node", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 4, - }, - "start": Object { - "column": 20, - "line": 4, - }, - }, - "range": Array [ - 90, - 91, - ], - "type": "Punctuator", - "value": ".", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "range": Array [ - 91, - 95, - ], - "type": "Identifier", - "value": "type", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 25, - "line": 4, - }, - }, - "range": Array [ - 95, - 96, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 4, - }, - "start": Object { - "column": 27, - "line": 4, - }, - }, - "range": Array [ - 97, - 98, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 111, - 115, - ], - "type": "Keyword", - "value": "case", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "range": Array [ - 116, - 136, - ], - "type": "String", - "value": "\\"SequenceExpression\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 5, - }, - "start": Object { - "column": 37, - "line": 5, - }, - }, - "range": Array [ - 136, - 137, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 6, - }, - "start": Object { - "column": 16, - "line": 6, - }, - }, - "range": Array [ - 154, - 160, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 6, - }, - "start": Object { - "column": 23, - "line": 6, - }, - }, - "range": Array [ - 161, - 171, - ], - "type": "Identifier", - "value": "isConstant", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 6, - }, - "start": Object { - "column": 33, - "line": 6, - }, - }, - "range": Array [ - 171, - 172, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 6, - }, - "start": Object { - "column": 34, - "line": 6, - }, - }, - "range": Array [ - 172, - 176, - ], - "type": "Identifier", - "value": "node", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 6, - }, - "start": Object { - "column": 38, - "line": 6, - }, - }, - "range": Array [ - 176, - 177, - ], - "type": "Punctuator", - "value": ".", - }, - Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 6, - }, - "start": Object { - "column": 39, - "line": 6, - }, - }, - "range": Array [ - 177, - 188, - ], - "type": "Identifier", - "value": "expressions", - }, - Object { - "loc": Object { - "end": Object { - "column": 51, - "line": 6, - }, - "start": Object { - "column": 50, - "line": 6, - }, - }, - "range": Array [ - 188, - 189, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 6, - }, - "start": Object { - "column": 51, - "line": 6, - }, - }, - "range": Array [ - 189, - 193, - ], - "type": "Identifier", - "value": "node", - }, - Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 6, - }, - "start": Object { - "column": 55, - "line": 6, - }, - }, - "range": Array [ - 193, - 194, - ], - "type": "Punctuator", - "value": ".", - }, - Object { - "loc": Object { - "end": Object { - "column": 67, - "line": 6, - }, - "start": Object { - "column": 56, - "line": 6, - }, - }, - "range": Array [ - 194, - 205, - ], - "type": "Identifier", - "value": "expressions", - }, - Object { - "loc": Object { - "end": Object { - "column": 68, - "line": 6, - }, - "start": Object { - "column": 67, - "line": 6, - }, - }, - "range": Array [ - 205, - 206, - ], - "type": "Punctuator", - "value": ".", - }, - Object { - "loc": Object { - "end": Object { - "column": 74, - "line": 6, - }, - "start": Object { - "column": 68, - "line": 6, - }, - }, - "range": Array [ - 206, - 212, - ], - "type": "Identifier", - "value": "length", - }, - Object { - "loc": Object { - "end": Object { - "column": 76, - "line": 6, - }, - "start": Object { - "column": 75, - "line": 6, - }, - }, - "range": Array [ - 213, - 214, - ], - "type": "Punctuator", - "value": "-", - }, - Object { - "loc": Object { - "end": Object { - "column": 78, - "line": 6, - }, - "start": Object { - "column": 77, - "line": 6, - }, - }, - "range": Array [ - 215, - 216, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 79, - "line": 6, - }, - "start": Object { - "column": 78, - "line": 6, - }, - }, - "range": Array [ - 216, - 217, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 80, - "line": 6, - }, - "start": Object { - "column": 79, - "line": 6, - }, - }, - "range": Array [ - 217, - 218, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 81, - "line": 6, - }, - "start": Object { - "column": 80, - "line": 6, - }, - }, - "range": Array [ - 218, - 219, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 8, - }, - "start": Object { - "column": 8, - "line": 8, - }, - }, - "range": Array [ - 254, - 255, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 9, - }, - }, - "range": Array [ - 264, - 270, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 9, - }, - "start": Object { - "column": 15, - "line": 9, - }, - }, - "range": Array [ - 271, - 276, - ], - "type": "Boolean", - "value": "false", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 9, - }, - "start": Object { - "column": 20, - "line": 9, - }, - }, - "range": Array [ - 276, - 277, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 10, - }, - "start": Object { - "column": 4, - "line": 10, - }, - }, - "range": Array [ - 282, - 283, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 12, - }, - "start": Object { - "column": 0, - "line": 12, - }, - }, - "range": Array [ - 285, - 286, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 12, - }, - "start": Object { - "column": 1, - "line": 12, - }, - }, - "range": Array [ - 286, - 287, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/template-string-block.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "expressions": Array [ - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 3, - 7, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "quasis": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "tail": false, - "type": "TemplateElement", - "value": Object { - "cooked": "", - "raw": "", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 9, - ], - "tail": true, - "type": "TemplateElement", - "value": Object { - "cooked": "", - "raw": "", - }, - }, - ], - "range": Array [ - 0, - 9, - ], - "type": "TemplateLiteral", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 10, - ], - "type": "ExpressionStatement", - }, - Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 56, - 57, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "operator": "+", - "range": Array [ - 56, - 61, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 60, - 61, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 56, - 62, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 11, - 64, - ], - "type": "BlockStatement", - }, - ], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 17, - 51, - ], - "type": "Block", - "value": " TODO comment comment comment ", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 65, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Template", - "value": "\`\${", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 7, - ], - "type": "Identifier", - "value": "name", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 9, - ], - "type": "Template", - "value": "}\`", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 56, - 57, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 4, - }, - }, - "range": Array [ - 58, - 59, - ], - "type": "Punctuator", - "value": "+", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 60, - 61, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "range": Array [ - 61, - 62, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 63, - 64, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; diff --git a/packages/parser/tests/lib/__snapshots__/javascript.ts.snap b/packages/parser/tests/lib/__snapshots__/javascript.ts.snap deleted file mode 100644 index 48864fb7402..00000000000 --- a/packages/parser/tests/lib/__snapshots__/javascript.ts.snap +++ /dev/null @@ -1,62958 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`javascript fixtures/arrayLiteral/array-literal-in-lhs.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "fn", - "range": Array [ - 0, - 2, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/arrayLiteral/array-literals-in-binary-expr.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 9, - ], - "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[`javascript fixtures/arrowFunctions/as-param.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 4, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "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, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/as-param-with-params.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 4, - 16, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 1, - }, - "y": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/basic.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/basic-in-binary-expression.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 1, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 19, - 28, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 28, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/block-body.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "e": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/block-body-not-object.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "e": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 18, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-dup-params.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - Object { - "name": Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-missing-paren.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/arrowFunctions/error-not-arrow.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/arrowFunctions/error-numeric-param.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/arrowFunctions/error-numeric-param-multi.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/arrowFunctions/error-reverse-arrow.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/arrowFunctions/error-strict-default-param-eval.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 14, - 31, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 22, - 24, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "eval": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 31, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - ], - "name": "eval", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-dup-params.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 14, - 26, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 26, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - Object { - "name": Object { - "name": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 26, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - Object { - "name": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-eval.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "eval": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eval", - "range": Array [ - 1, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eval", - "range": Array [ - 1, - 5, - ], - "type": "Identifier", - }, - ], - "name": "eval", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-eval-return.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 14, - 26, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "eval": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 26, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - ], - "name": "eval", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-octal.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 14, - 23, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 23, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-param-arguments.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 14, - 34, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 1, - }, - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "arguments", - "range": Array [ - 15, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 34, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "arguments", - "range": Array [ - 15, - 24, - ], - "type": "Identifier", - }, - ], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 34, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 26, - 27, - ], - "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 {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-param-eval.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 14, - 29, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 1, - }, - "eval": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 29, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - ], - "name": "eval", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 29, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "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 {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-param-names.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 14, - 29, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 1, - }, - "eval": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 29, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eval", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - ], - "name": "eval", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 29, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "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 {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-param-no-paren-arguments.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 14, - 29, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "arguments", - "range": Array [ - 14, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 29, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "arguments", - "range": Array [ - 14, - 23, - ], - "type": "Identifier", - }, - ], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-strict-param-no-paren-eval.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 14, - 24, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "eval": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eval", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 24, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eval", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - }, - ], - "name": "eval", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/error-two-lines.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 8, - 16, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 16, - ], - "type": "ArrowFunctionExpression", - }, - }, - ], - "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 [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 17, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/arrowFunctions/error-wrapped-param.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/arrowFunctions/expression.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 1, - 7, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 7, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/iife.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "e": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/multiple-params.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 16, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 16, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/no-auto-return.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": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 17, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 17, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/not-strict-arguments.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "arguments", - "range": Array [ - 0, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "arguments", - "range": Array [ - 0, - 9, - ], - "type": "Identifier", - }, - ], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/not-strict-eval.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "eval": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eval", - "range": Array [ - 0, - 4, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eval", - "range": Array [ - 0, - 4, - ], - "type": "Identifier", - }, - ], - "name": "eval", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/not-strict-eval-params.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": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 1, - }, - "eval": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eval", - "range": Array [ - 1, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eval", - "range": Array [ - 1, - 5, - ], - "type": "Identifier", - }, - ], - "name": "eval", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "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 {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/not-strict-octal.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/return-arrow-function.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 5, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "y": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 5, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 12, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/return-sequence.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 8, - 27, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 27, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 27, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/single-param.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "e": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 11, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/single-param-parens.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "e": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 13, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/arrowFunctions/single-param-return-identifier.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "earth", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "sun": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "sun", - "range": Array [ - 1, - 4, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 14, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "sun", - "range": Array [ - 1, - 4, - ], - "type": "Identifier", - }, - ], - "name": "sun", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/basics/and-operator-array-object.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "v", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 42, - ], - "type": "LogicalExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 52, - 86, - ], - "type": "LogicalExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 96, - 104, - ], - "type": "LogicalExpression", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 110, - 111, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 114, - 122, - ], - "type": "LogicalExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "v": Object { - "$ref": 0, - }, - "x": Object { - "$ref": 1, - }, - "y": Object { - "$ref": 3, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "v", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 42, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 43, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "v", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "v", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 48, - 86, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 44, - 87, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 92, - 104, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 88, - 105, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 110, - 111, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 110, - 122, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 123, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 110, - 111, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "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[`javascript fixtures/basics/delete-expression.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "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[`javascript fixtures/basics/do-while-statements.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 59, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 59, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 29, - 43, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 39, - 40, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 23, - 24, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 51, - 52, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "i": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 15, - 25, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 2, - }, - ], - "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[`javascript fixtures/basics/identifiers-double-underscore.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 20, - 36, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "__Foo": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 36, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - ], - "name": "__Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 38, - 59, - ], - "type": "FunctionDeclaration", - }, - "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 [ - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "__test", - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 17, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "__Bar": Object { - "$ref": 2, - }, - "__Foo": Object { - "$ref": 1, - }, - "__test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "__test", - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "__test", - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - }, - ], - "name": "__test", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 36, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - ], - "name": "__Foo", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "__Bar", - "range": Array [ - 47, - 52, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 38, - 59, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "__Bar", - "range": Array [ - 47, - 52, - ], - "type": "Identifier", - }, - ], - "name": "__Bar", - "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[`javascript fixtures/basics/instanceof.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "Set", - "range": Array [ - 14, - 17, - ], - "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[`javascript fixtures/basics/new-with-member-expression.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, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "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[`javascript fixtures/basics/new-without-parens.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "FunctionDeclaration", - }, - "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 [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "X", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "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 [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 16, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "X", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/basics/or-operator-array-object.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "v", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 42, - ], - "type": "LogicalExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 52, - 86, - ], - "type": "LogicalExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 96, - 104, - ], - "type": "LogicalExpression", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 110, - 111, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 114, - 122, - ], - "type": "LogicalExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "v": Object { - "$ref": 0, - }, - "x": Object { - "$ref": 1, - }, - "y": Object { - "$ref": 3, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "v", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 42, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 43, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "v", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "v", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 48, - 86, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 44, - 87, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 92, - 104, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 88, - 105, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 110, - 111, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 110, - 122, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 123, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 110, - 111, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "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[`javascript fixtures/basics/typeof-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 13, - ], - "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[`javascript fixtures/basics/update-expression.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 11, - 34, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": null, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 9, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "f": Object { - "$ref": 1, - }, - "i": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 34, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "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[`javascript fixtures/basics/void-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 17, - ], - "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[`javascript fixtures/bigIntLiterals/binary.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 6, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 6, - ], - "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[`javascript fixtures/bigIntLiterals/decimal.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 4, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 4, - ], - "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[`javascript fixtures/bigIntLiterals/hex.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 6, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 6, - ], - "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[`javascript fixtures/bigIntLiterals/numeric-separator.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 8, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 8, - ], - "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[`javascript fixtures/bigIntLiterals/octal.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 6, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 6, - ], - "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[`javascript fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/binaryLiterals/lowercase.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 7, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 7, - ], - "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[`javascript fixtures/binaryLiterals/uppercase.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 7, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 7, - ], - "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[`javascript fixtures/blockBindings/const.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "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 { - "name": "bar", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 12, - 15, - ], - "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 [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 15, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 16, - ], - "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": 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[`javascript fixtures/blockBindings/let.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "bar", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 10, - 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 [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 14, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - 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[`javascript fixtures/blockBindings/let-in-switchcase.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "SwitchStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "t", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 35, - 37, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "switch", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "t": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "t", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 31, - 37, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 27, - 38, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "t", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - ], - "name": "t", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "answer", - "range": Array [ - 8, - 14, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/callExpression/call-expression-with-array.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "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[`javascript fixtures/callExpression/call-expression-with-object.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "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[`javascript fixtures/callExpression/mixed-expression.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 1, - 65, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 18, - 57, - ], - "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": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/callExpression/new-expression-with-array.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/callExpression/new-expression-with-object.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": "bar", - "range": Array [ - 4, - 7, - ], - "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[`javascript fixtures/classes/class-accessor-properties.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 14, - 18, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "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": 6, - "block": Object { - "range": Array [ - 24, - 29, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "c": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 24, - 29, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 31, - ], - "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": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 31, - ], - "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": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-computed-static-method.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 19, - 23, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-expression.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 1, - 9, - ], - "type": "ClassExpression", - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-method-named-prototype.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 18, - 22, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-method-named-static.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 15, - 19, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 21, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 21, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-method-named-with-space.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 19, - 24, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-one-method.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 15, - 19, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 21, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 21, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-one-method-super.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 15, - 41, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-static-method.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 17, - 21, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-static-method-named-prototype.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 29, - 33, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-static-method-named-static.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 22, - 26, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-static-methods-and-accessor-properties.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 59, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 59, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 17, - 21, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "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 [ - 34, - 38, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "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": 8, - "block": Object { - "range": Array [ - 51, - 56, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - "b": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 52, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 51, - 56, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 52, - 53, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 58, - ], - "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": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 58, - ], - "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": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-two-computed-static-methods.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 18, - 22, - ], - "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 [ - 33, - 37, - ], - "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 [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 38, - ], - "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": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 38, - ], - "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": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-two-methods.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 10, - 14, - ], - "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 [ - 15, - 19, - ], - "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, - 20, - ], - "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, - 20, - ], - "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[`javascript fixtures/classes/class-two-methods-computed-constructor.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 22, - 26, - ], - "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 [ - 42, - 46, - ], - "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, - 47, - ], - "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, - 47, - ], - "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[`javascript fixtures/classes/class-two-methods-semi.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 10, - 14, - ], - "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 [ - 16, - 20, - ], - "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, - 21, - ], - "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, - 21, - ], - "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[`javascript fixtures/classes/class-two-methods-three-semi.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 11, - 15, - ], - "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 [ - 17, - 21, - ], - "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, - 23, - ], - "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, - 23, - ], - "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[`javascript fixtures/classes/class-two-methods-two-semi.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 10, - 14, - ], - "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 [ - 16, - 20, - ], - "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, - 22, - ], - "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, - 22, - ], - "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[`javascript fixtures/classes/class-two-static-methods-named-constructor.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 56, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 56, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 27, - 31, - ], - "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 [ - 50, - 54, - ], - "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, - 55, - ], - "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, - 55, - ], - "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[`javascript fixtures/classes/class-with-constructor.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 20, - 24, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-with-constructor-parameters.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 20, - 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, - }, - "bar": Object { - "$ref": 4, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 32, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 32, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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, - 33, - ], - "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, - 33, - ], - "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[`javascript fixtures/classes/class-with-constructor-with-space.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 21, - 25, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 26, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 26, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/class-with-no-body.src 1`] = `"'{' expected."`; - -exports[`javascript fixtures/classes/derived-class-assign-to-var.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 8, - 27, - ], - "type": "ClassExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "A": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 27, - ], - "type": "ClassExpression", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 27, - ], - "type": "ClassExpression", - }, - }, - ], - "throughReferences": Array [], - "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 [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/classes/derived-class-expression.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 1, - 18, - ], - "type": "ClassExpression", - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/empty-class.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "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, - 10, - ], - "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, - 10, - ], - "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[`javascript fixtures/classes/empty-class-double-semi.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "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, - 10, - ], - "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, - 10, - ], - "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[`javascript fixtures/classes/empty-class-semi.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 11, - ], - "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, - 11, - ], - "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, - 11, - ], - "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[`javascript fixtures/classes/empty-literal-derived-class.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 [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "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, - 20, - ], - "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, - 20, - ], - "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[`javascript fixtures/classes/invalid-class-declaration.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 8, - ], - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/invalid-class-setter-declaration.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 17, - 22, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "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": 4, - }, - }, - ], - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/invalid-class-two-super-classes.src 1`] = `"Classes can only extend a single class."`; - -exports[`javascript fixtures/classes/named-class-expression.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 1, - 11, - ], - "type": "ClassExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 11, - ], - "type": "ClassExpression", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/classes/named-derived-class-expression.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 1, - 20, - ], - "type": "ClassExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 20, - ], - "type": "ClassExpression", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/commaOperator/comma-operator-conditional.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "xx", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 26, - ], - "type": "SequenceExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "xx", - "range": Array [ - 10, - 12, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": null, - "writeExpr": null, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "xx": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "xx", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "xx", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - ], - "name": "xx", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/commaOperator/comma-operator-multi.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "v1", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 29, - ], - "type": "SequenceExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "v1": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "v1", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "v1", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - ], - "name": "v1", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/commaOperator/comma-operator-nested.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "v1", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 33, - ], - "type": "SequenceExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "v1": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "v1", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 35, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "v1", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - ], - "name": "v1", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/commaOperator/comma-operator-return.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 26, - 27, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "v1", - "range": Array [ - 41, - 43, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 18, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "f1": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f1", - "range": Array [ - 9, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f1", - "range": Array [ - 9, - 11, - ], - "type": "Identifier", - }, - ], - "name": "f1", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/commaOperator/comma-operator-simple.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 14, - ], - "type": "Literal", - }, - }, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 15, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 16, - ], - "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": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/commaOperator/comma-operator-simple-nested.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 15, - 19, - ], - "type": "SequenceExpression", - }, - }, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "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": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/defaultParams/class-constructor.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 25, - 44, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 30, - 35, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 44, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "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, - 46, - ], - "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, - 46, - ], - "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[`javascript fixtures/defaultParams/class-method.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 36, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 22, - 27, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 36, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "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, - 38, - ], - "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, - 38, - ], - "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[`javascript fixtures/defaultParams/declaration.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 15, - 16, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 20, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 20, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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[`javascript fixtures/defaultParams/expression.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 4, - 22, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 17, - 18, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "y": 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": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 4, - 22, - ], - "type": "FunctionExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/defaultParams/method.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 9, - 25, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 20, - 21, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 25, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 4, - 27, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/defaultParams/not-all-params.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 10, - 35, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 26, - 28, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "arguments": Object { - "$ref": 2, - }, - "b": Object { - "$ref": 4, - }, - "c": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 10, - 35, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 10, - 35, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 10, - 35, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 35, - ], - "type": "FunctionExpression", - }, - }, - ], - "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 [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring/array-member.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "ok", - "range": Array [ - 1, - 3, - ], - "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[`javascript fixtures/destructuring/array-to-array.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 9, - 15, - ], - "type": "ArrayExpression", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 9, - 15, - ], - "type": "ArrayExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/array-var-undefined.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 12, - ], - "type": "ArrayExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 13, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring/call-expression-destruction-array.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "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[`javascript fixtures/destructuring/call-expression-destruction-object.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "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[`javascript fixtures/destructuring/class-constructor-params-array.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 25, - 45, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 4, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 45, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 45, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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, - 47, - ], - "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, - 47, - ], - "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[`javascript fixtures/destructuring/class-constructor-params-defaults-array.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 25, - 49, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 31, - 32, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 38, - 39, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 4, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 49, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 49, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 34, - 37, - ], - "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 { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "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": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "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": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/class-constructor-params-defaults-object.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 25, - 49, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 31, - 32, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 38, - 39, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 4, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 49, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 49, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 34, - 37, - ], - "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 { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "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": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "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": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/class-constructor-params-object.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 25, - 45, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 4, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 45, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 45, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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, - 47, - ], - "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, - 47, - ], - "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[`javascript fixtures/destructuring/class-method-params-array.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 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, - }, - "bar": Object { - "$ref": 3, - }, - "baz": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 37, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 37, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "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, - 39, - ], - "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, - 39, - ], - "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[`javascript fixtures/destructuring/class-method-params-defaults-array.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 17, - 41, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 23, - 24, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 30, - 31, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 3, - }, - "baz": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 41, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 41, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "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 { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "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": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "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": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/class-method-params-defaults-object.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 17, - 41, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 23, - 24, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 30, - 31, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 3, - }, - "baz": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 41, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 41, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "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 { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "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": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "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": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/class-method-params-object.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 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, - }, - "bar": Object { - "$ref": 3, - }, - "baz": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 37, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 37, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "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, - 39, - ], - "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, - 39, - ], - "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[`javascript fixtures/destructuring/defaults-array.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 3, - 5, - ], - "type": "Literal", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "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[`javascript fixtures/destructuring/defaults-array-all.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 17, - 18, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 24, - 25, - ], - "type": "Literal", - }, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 9, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 9, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-array-longform-nested-multi.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "b", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "b", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 29, - 31, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "b", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 38, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 39, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 38, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 39, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 38, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 39, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-array-multi.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-array-nested-all.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 19, - 21, - ], - "type": "Literal", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "z": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-array-nested-multi.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "z": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 23, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 24, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 23, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 24, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-object.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "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 [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 16, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "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[`javascript fixtures/destructuring/defaults-object-all.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 17, - 18, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 24, - 25, - ], - "type": "Literal", - }, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 9, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 9, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-object-assign.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Object", - "range": Array [ - 3, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Object", - "range": Array [ - 3, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 26, - 28, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "String", - "range": Array [ - 13, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 20, - 21, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "String", - "range": Array [ - 13, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 26, - 28, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-object-longform.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 15, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "x", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "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 [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "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[`javascript fixtures/destructuring/defaults-object-longform-all.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 14, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 23, - 25, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 34, - 36, - ], - "type": "Literal", - }, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 9, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 41, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 42, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 41, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 42, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 41, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 42, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 9, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-object-longform-multi.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 18, - 20, - ], - "type": "Literal", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-object-mixed-multi.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 15, - 17, - ], - "type": "Literal", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-object-multi.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-object-nested-all.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 22, - 24, - ], - "type": "Literal", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "z": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/defaults-object-nested-multi.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "z": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 26, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 27, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 26, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 27, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/destructured-array-catch.src 1`] = ` -Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 24, - 46, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], - }, - Object { - "$id": 9, - "block": Object { - "range": Array [ - 49, - 69, - ], - "type": "CatchClause", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 64, - 69, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "catch", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "stack": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "range": Array [ - 55, - 62, - ], - "type": "ArrayPattern", - }, - "node": Object { - "range": Array [ - 49, - 69, - ], - "type": "CatchClause", - }, - "parent": null, - "type": "CatchClause", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "stack", - "range": Array [ - 56, - 61, - ], - "type": "Identifier", - }, - ], - "name": "stack", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 41, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 30, - 42, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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[`javascript fixtures/destructuring/destructured-object-catch.src 1`] = ` -Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 24, - 46, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], - }, - Object { - "$id": 9, - "block": Object { - "range": Array [ - 49, - 69, - ], - "type": "CatchClause", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 64, - 69, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "catch", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "stack": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "range": Array [ - 55, - 62, - ], - "type": "ObjectPattern", - }, - "node": Object { - "range": Array [ - 49, - 69, - ], - "type": "CatchClause", - }, - "parent": null, - "type": "CatchClause", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "stack", - "range": Array [ - 56, - 61, - ], - "type": "Identifier", - }, - ], - "name": "stack", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 41, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 30, - 42, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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[`javascript fixtures/destructuring/invalid-defaults-object-assign.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "Object", - "range": Array [ - 3, - 9, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "String", - "range": Array [ - 13, - 19, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/destructuring/named-param.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "text", - "range": Array [ - 17, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "res", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "res", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/destructuring/nested-array.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 19, - 30, - ], - "type": "ArrayExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 19, - 30, - ], - "type": "ArrayExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "z": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "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[`javascript fixtures/destructuring/nested-object.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 27, - 52, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 27, - 52, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "b": Object { - "$ref": 1, - }, - "y": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 52, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 53, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 52, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 53, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "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[`javascript fixtures/destructuring/object-var-named.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 14, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "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 [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring/object-var-undefined.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 12, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 13, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring/param-defaults-array.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 16, - 18, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": 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": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "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, - 23, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/param-defaults-object.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 16, - 18, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": 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": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "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, - 23, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/param-defaults-object-nested.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 16, - 18, - ], - "type": "Literal", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 29, - 31, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": Object { - "$ref": 2, - }, - "z": Object { - "$ref": 3, - }, - }, - "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": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 38, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 38, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "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 [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 38, - ], - "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": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/params-array.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": 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": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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[`javascript fixtures/destructuring/params-array-wrapped.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": 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": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": true, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function-expression-name", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/params-multi-object.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": 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": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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[`javascript fixtures/destructuring/params-nested-array.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": Object { - "$ref": 2, - }, - "z": 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": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "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, - 27, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/params-nested-object.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "b": Object { - "$ref": 3, - }, - "y": 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": "y", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 35, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 35, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "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, - 35, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/params-object.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": 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": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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[`javascript fixtures/destructuring/params-object-wrapped.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": 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": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": true, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function-expression-name", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring/sparse-array.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "array", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "array", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "array", - "range": Array [ - 9, - 14, - ], - "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[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "y": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 1, - }, - "y": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 1, - }, - "y": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 17, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 17, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 1, - }, - "y": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "y": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 6, - 8, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 6, - 8, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 6, - 8, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 19, - 21, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "z": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 35, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 35, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-blockBindings/array-const-undefined.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 14, - ], - "type": "ArrayExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring-and-blockBindings/array-let-undefined.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 12, - ], - "type": "ArrayExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 13, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring-and-blockBindings/object-const-named.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 14, - 16, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "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 [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 17, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring-and-blockBindings/object-const-undefined.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 14, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring-and-blockBindings/object-let-named.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 14, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "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 [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring-and-blockBindings/object-let-undefined.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 12, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 13, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/destructuring-and-defaultParams/param-array.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 17, - 20, - ], - "type": "ArrayExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": 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": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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[`javascript fixtures/destructuring-and-defaultParams/param-object.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 4, - 30, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 19, - 26, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": 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": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 4, - 30, - ], - "type": "FunctionExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-defaultParams/param-object-short.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 3, - 21, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 10, - 17, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - "x": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 3, - 21, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-defaultParams/param-object-wrapped.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 5, - 31, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 20, - 27, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - "x": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 5, - 31, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-forOf/loop.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-spread/destructured-array-literal.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 [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": Object { - "$ref": 3, - }, - "ok": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "ok", - "range": Array [ - 22, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "ok", - "range": Array [ - 22, - 24, - ], - "type": "Identifier", - }, - ], - "name": "ok", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "d", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-spread/invalid-not-final-array-empty.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "b", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "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[`javascript fixtures/destructuring-and-spread/not-final-array.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "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[`javascript fixtures/destructuring-and-spread/single-destructured.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/destructuring-and-spread/var-complex-destructured.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "d", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "d", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "d", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - "c": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 25, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 25, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 25, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-spread/var-destructured-array-literal.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "d", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "d", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "d", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - "c": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-spread/var-multi-destructured.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "c", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "c", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/destructuring-and-spread/var-single-destructured.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "b", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "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 [ - 8, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - 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[`javascript fixtures/directives/block.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 64, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 64, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 43, - 44, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "a", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 39, - 44, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 35, - 45, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "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 [ - 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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/directives/directive-in-class.src 1`] = ` -Object { - "$id": 13, - "block": Object { - "range": Array [ - 0, - 220, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 220, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 15, - 219, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 43, - 75, - ], - "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 [ - 89, - 121, - ], - "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": 8, - "block": Object { - "range": Array [ - 135, - 172, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - "value": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "value", - "range": Array [ - 136, - 141, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 135, - 172, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "value", - "range": Array [ - 136, - 141, - ], - "type": "Identifier", - }, - ], - "name": "value", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - Object { - "$id": 10, - "block": Object { - "range": Array [ - 185, - 217, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 9, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 9, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 219, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 219, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/directives/first-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 121, - 130, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 121, - 130, - ], - "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[`javascript fixtures/directives/function-non-strict.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 39, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 39, - ], - "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": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/directives/non-directive-string.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 172, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 172, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 10, - 30, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 32, - 136, - ], - "type": "SwitchStatement", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 64, - 92, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - Object { - "$id": 2, - "block": Object { - "range": Array [ - 106, - 134, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "switch", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - Object { - "$id": 4, - "block": Object { - "range": Array [ - 151, - 171, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/directives/non-unique-directive.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 36, - ], - "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[`javascript fixtures/directives/program.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 22, - 23, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 18, - 23, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 14, - 24, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/directives/program-order.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 31, - 32, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 27, - 33, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/directives/raw.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 17, - ], - "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[`javascript fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 26, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 16, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 26, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 16, - 19, - ], - "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[`javascript fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 69, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 27, - 67, - ], - "type": "ForOfStatement", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 59, - 67, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "item", - "range": Array [ - 44, - 48, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "items", - "range": Array [ - 52, - 57, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "items", - "range": Array [ - 52, - 57, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "item": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "item", - "range": Array [ - 44, - 48, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 38, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "item", - "range": Array [ - 44, - 48, - ], - "type": "Identifier", - }, - ], - "name": "item", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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 [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 69, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "main", - "range": Array [ - 19, - 23, - ], - "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[`javascript fixtures/experimentalDynamicImport/error-dynamic-import-params.src 1`] = `"Dynamic import must have one specifier as an argument."`; - -exports[`javascript fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": 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": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "c": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "c", - "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[`javascript fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 13, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 13, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "bar": 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": "bar", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 26, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 26, - ], - "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": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; - -exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 21, - 47, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 21, - 47, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 21, - 47, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "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[`javascript fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 84, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 84, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 36, - 82, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "get", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "set", - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - "get": Object { - "$ref": 1, - }, - "set": Object { - "$ref": 2, - }, - "x": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - ], - "name": "set", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 82, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 28, - 83, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "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[`javascript fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 109, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 109, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 17, - 104, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - "options": Object { - "$ref": 3, - }, - "otherVar": Object { - "$ref": 2, - }, - "someVar": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "someVar", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 104, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "someVar", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - ], - "name": "someVar", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "otherVar", - "range": Array [ - 28, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 104, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "otherVar", - "range": Array [ - 28, - 36, - ], - "type": "Identifier", - }, - ], - "name": "otherVar", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "options", - "range": Array [ - 41, - 48, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 104, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "options", - "range": Array [ - 41, - 48, - ], - "type": "Identifier", - }, - ], - "name": "options", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 114, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 114, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 24, - 111, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "options": Object { - "$ref": 5, - }, - "otherVar": Object { - "$ref": 4, - }, - "someVar": Object { - "$ref": 3, - }, - }, - "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": "someVar", - "range": Array [ - 26, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 24, - 111, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "someVar", - "range": Array [ - 26, - 33, - ], - "type": "Identifier", - }, - ], - "name": "someVar", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "otherVar", - "range": Array [ - 35, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 24, - 111, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "otherVar", - "range": Array [ - 35, - 43, - ], - "type": "Identifier", - }, - ], - "name": "otherVar", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "options", - "range": Array [ - 48, - 55, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 24, - 111, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "options", - "range": Array [ - 48, - 55, - ], - "type": "Identifier", - }, - ], - "name": "options", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 113, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 113, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 114, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 36, - 68, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "get", - "range": Array [ - 51, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "set", - "range": Array [ - 63, - 66, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - "get": Object { - "$ref": 1, - }, - "set": Object { - "$ref": 2, - }, - "x": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - ], - "name": "set", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 68, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 28, - 69, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "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[`javascript fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 80, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 80, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 36, - 78, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "get", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "set", - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - "get": Object { - "$ref": 1, - }, - "set": Object { - "$ref": 2, - }, - "x": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - ], - "name": "set", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 78, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 28, - 79, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "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[`javascript fixtures/experimentalObjectRestSpread/spread-trailing-comma.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 [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "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[`javascript fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 36, - 76, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "get", - "range": Array [ - 59, - 62, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "set", - "range": Array [ - 71, - 74, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - "get": Object { - "$ref": 1, - }, - "set": Object { - "$ref": 2, - }, - "x": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - ], - "name": "set", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 76, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 28, - 77, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "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[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding.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": 0, - "block": Object { - "range": Array [ - 4, - 6, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 15, - ], - "type": "CatchClause", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 13, - 15, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "catch", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 4, - 6, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 15, - ], - "type": "CatchClause", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 13, - 15, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "catch", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 24, - 26, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "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 {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/exponentiationOperators/exponential-operators.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 14, - ], - "type": "BinaryExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 22, - 23, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "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[`javascript fixtures/for/for-empty.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 10, - ], - "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[`javascript fixtures/for/for-loop.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 28, - 30, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 13, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": null, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "i": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 4, - 13, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "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[`javascript fixtures/for/for-with-coma.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 41, - 44, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 14, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "j", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 20, - 22, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "j", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": null, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "j", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": null, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "i": Object { - "$ref": 0, - }, - "j": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "j", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 16, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "j", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - ], - "name": "j", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 7, - }, - ], - "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[`javascript fixtures/for/for-with-const.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "ForStatement", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 26, - 29, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 15, - 16, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "j", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "i": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 16, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/for/for-with-function.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 9, - 10, - ], - "type": "Literal", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 16, - 33, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 39, - 40, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/for/for-with-let.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "ForStatement", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 26, - 29, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 15, - 16, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "j", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "i": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 16, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-array.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 14, - 16, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 10, - 12, - ], - "type": "ArrayExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "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, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-bare-nonstrict.src 1`] = ` -Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 133, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 13, - "block": Object { - "range": Array [ - 0, - 133, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 12, - "block": Object { - "range": Array [ - 113, - 132, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 11, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "iterations", - "range": Array [ - 119, - 129, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": null, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 11, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "effects", - "range": Array [ - 4, - 11, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 14, - 15, - ], - "type": "Literal", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "iterations", - "range": Array [ - 21, - 31, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 34, - 35, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 58, - 59, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 63, - 76, - ], - "type": "SequenceExpression", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "effects", - "range": Array [ - 65, - 72, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": null, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 58, - 59, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 81, - 111, - ], - "type": "SequenceExpression", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "stored", - "range": Array [ - 81, - 87, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 90, - 91, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 90, - 91, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "effects": Object { - "$ref": 0, - }, - "iterations": Object { - "$ref": 1, - }, - "stored": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "effects", - "range": Array [ - 4, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 15, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 16, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "effects", - "range": Array [ - 4, - 11, - ], - "type": "Identifier", - }, - ], - "name": "effects", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "iterations", - "range": Array [ - 21, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 17, - 36, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "iterations", - "range": Array [ - 21, - 31, - ], - "type": "Identifier", - }, - ], - "name": "iterations", - "references": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "stored", - "range": Array [ - 41, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 41, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 37, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "stored", - "range": Array [ - 41, - 47, - ], - "type": "Identifier", - }, - ], - "name": "stored", - "references": Array [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 58, - 59, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 77, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 54, - 77, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 58, - 59, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-destruction.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 31, - 33, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "name": Object { - "$ref": 0, - }, - "value": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - ], - "name": "value", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-destruction-object.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 31, - 33, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "name": Object { - "$ref": 0, - }, - "value": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - ], - "name": "value", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-object.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/forIn/for-in-object-with-body.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 14, - 16, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 10, - 12, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "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, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-with-assigment.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "ForInStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 15, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "list", - "range": Array [ - 19, - 23, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "list", - "range": Array [ - 19, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "process", - "range": Array [ - 25, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 15, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-with-bare-assigment.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 9, - 10, - ], - "type": "Literal", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "arr", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "arr", - "range": Array [ - 14, - 17, - ], - "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[`javascript fixtures/forIn/for-in-with-const.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "ForInStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "list", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "list", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "process", - "range": Array [ - 22, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 12, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-with-milti-asigment.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 18, - ], - "type": "AssignmentExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "z", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "q", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "q", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-with-rest.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 [ - 38, - 41, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "xx", - "range": Array [ - 10, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "array", - "range": Array [ - 31, - 36, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "rrestOff", - "range": Array [ - 17, - 25, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "array", - "range": Array [ - 31, - 36, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "array", - "range": Array [ - 31, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "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": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forIn/for-in-with-var.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "list", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "list", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "process", - "range": Array [ - 20, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/for-of-array.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "ForOfStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 14, - 16, - ], - "type": "ArrayExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "doSomething", - "range": Array [ - 22, - 33, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/for-of-destruction.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 31, - 33, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "name": Object { - "$ref": 0, - }, - "value": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - ], - "name": "value", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/for-of-destruction-object.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 31, - 33, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "name": Object { - "$ref": 0, - }, - "value": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - ], - "name": "value", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/for-of-object.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "ForOfStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 14, - 16, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "doSomething", - "range": Array [ - 22, - 33, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/for-of-with-function-initializer.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 13, - 43, - ], - "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 [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 43, - ], - "type": "FunctionExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "i", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "list", - "range": Array [ - 47, - 51, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "list", - "range": Array [ - 47, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "process", - "range": Array [ - 53, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 61, - 62, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "i": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "i", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 43, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 43, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "i", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "i", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/for-of-with-rest.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 [ - 38, - 41, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "xx", - "range": Array [ - 10, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "array", - "range": Array [ - 31, - 36, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "rrestOff", - "range": Array [ - 17, - 25, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "array", - "range": Array [ - 31, - 36, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "array", - "range": Array [ - 31, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "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": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 19, - 41, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "doSomething", - "range": Array [ - 25, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "doSomething", - "range": Array [ - 23, - 34, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "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 [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/invalid-for-of-with-const-and-no-braces.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": 4, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "ForOfStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "foo", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "doSomething", - "range": Array [ - 25, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 12, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "ForOfStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "doSomething", - "range": Array [ - 23, - 34, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "for", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 5, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/function/return-multiline-sequence.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 47, - 48, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 54, - 55, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": Object { - "$ref": 2, - }, - "y": Object { - "$ref": 3, - }, - "z": Object { - "$ref": 4, - }, - }, - "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": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "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": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/function/return-sequence.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 41, - 42, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": Object { - "$ref": 2, - }, - "y": Object { - "$ref": 3, - }, - "z": Object { - "$ref": 4, - }, - }, - "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": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 46, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 46, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 46, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], - "name": "z", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 46, - ], - "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": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/generators/anonymous-generator.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 1, - 25, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "v", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/generators/async-generator-function.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 1, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 1, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 1, - 27, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 1, - 27, - ], - "type": "FunctionDeclaration", - }, - "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[`javascript fixtures/generators/async-generator-method.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 66, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 66, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 23, - 63, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 46, - 56, - ], - "type": "YieldExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "g", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "x": Object { - "$ref": 3, - }, - }, - "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": "x", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 56, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 36, - 57, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 65, - ], - "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": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 65, - ], - "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": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/generators/double-yield.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 1, - 32, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/generators/empty-generator-declaration.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "t": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "t", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 16, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "t", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - ], - "name": "t", - "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[`javascript fixtures/generators/generator-declaration.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "v", - "range": Array [ - 27, - 28, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - ], - "name": "test", - "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[`javascript fixtures/generators/yield-delegation.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 1, - 26, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "v", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/generators/yield-without-value.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 1, - 24, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/generators/yield-without-value-in-call.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 1, - 28, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "fn", - "range": Array [ - 16, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/generators/yield-without-value-no-semi.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/globalReturn/return-identifier.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "fooz", - "range": Array [ - 7, - 11, - ], - "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[`javascript fixtures/globalReturn/return-no-arg.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 8, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 8, - ], - "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[`javascript fixtures/globalReturn/return-true.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 13, - ], - "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[`javascript fixtures/hexLiterals/invalid.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/hexLiterals/lowercase.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 8, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 8, - ], - "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[`javascript fixtures/hexLiterals/uppercase.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 8, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 8, - ], - "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[`javascript fixtures/importMeta/simple-import-meta.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 17, - ], - "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[`javascript fixtures/labels/label-break.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 21, - 54, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/labels/label-continue.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 61, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 61, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 21, - 60, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/modules/error-delete.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 8, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/modules/error-function.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 41, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "friends", - "range": Array [ - 31, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "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 [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 41, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "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[`javascript fixtures/modules/error-strict.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 28, - 64, - ], - "type": "WithStatement", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 41, - 64, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "console", - "range": Array [ - 44, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "roof", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "with", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "house", - "range": Array [ - 34, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "house": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "house", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 12, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "house", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - ], - "name": "house", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/modules/export-async-named-function.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 30, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 22, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 30, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 22, - 25, - ], - "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[`javascript fixtures/modules/export-const.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 19, - 20, - ], - "type": "Literal", - }, - }, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 7, - 21, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/modules/export-default-array.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 19, - ], - "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[`javascript fixtures/modules/export-default-async-named-function.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 15, - 38, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 30, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 38, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 30, - 33, - ], - "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[`javascript fixtures/modules/export-default-class.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 15, - 25, - ], - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/modules/export-default-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 24, - ], - "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[`javascript fixtures/modules/export-default-function.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 15, - 29, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/modules/export-default-named-class.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 15, - 30, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Test": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 21, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 30, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 21, - 25, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 21, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 30, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 21, - 25, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "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[`javascript fixtures/modules/export-default-named-function.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 15, - 32, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 24, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 32, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 24, - 27, - ], - "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[`javascript fixtures/modules/export-default-number.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 19, - ], - "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[`javascript fixtures/modules/export-default-object.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "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[`javascript fixtures/modules/export-default-value.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 15, - 18, - ], - "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[`javascript fixtures/modules/export-from-batch.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 21, - ], - "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[`javascript fixtures/modules/export-from-default.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "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[`javascript fixtures/modules/export-from-named-as-default.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 36, - ], - "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[`javascript fixtures/modules/export-from-named-as-specifier.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 32, - ], - "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[`javascript fixtures/modules/export-from-named-as-specifiers.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 41, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 41, - ], - "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[`javascript fixtures/modules/export-from-specifier.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 25, - ], - "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[`javascript fixtures/modules/export-from-specifiers.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 30, - ], - "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[`javascript fixtures/modules/export-function.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 25, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 16, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 25, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 16, - 19, - ], - "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[`javascript fixtures/modules/export-let.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 17, - 18, - ], - "type": "Literal", - }, - }, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 7, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/modules/export-named-as-default.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 8, - 11, - ], - "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[`javascript fixtures/modules/export-named-as-specifier.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 8, - 11, - ], - "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[`javascript fixtures/modules/export-named-as-specifiers.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/modules/export-named-class.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 22, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Test": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 22, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 22, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "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[`javascript fixtures/modules/export-named-empty.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 11, - ], - "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[`javascript fixtures/modules/export-named-specifier.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 [ - 8, - 11, - ], - "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[`javascript fixtures/modules/export-named-specifiers.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/modules/export-named-specifiers-comma.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/modules/export-var.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "bar": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 7, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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[`javascript fixtures/modules/export-var-anonymous-function.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 17, - 31, - ], - "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 [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 17, - 31, - ], - "type": "FunctionExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 7, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/modules/export-var-number.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 17, - 18, - ], - "type": "Literal", - }, - }, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 7, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/modules/import-default.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 [], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 10, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "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[`javascript fixtures/modules/import-default-and-named-specifiers.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "bar": Object { - "$ref": 1, - }, - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 10, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 16, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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[`javascript fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "bar": Object { - "$ref": 1, - }, - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 10, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 20, - ], - "type": "ImportNamespaceSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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[`javascript fixtures/modules/import-default-as.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 { - "name": Object { - "name": "foo", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 22, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 35, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 19, - 22, - ], - "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[`javascript fixtures/modules/import-jquery.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 [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "$": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "$", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 8, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "$", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "$", - "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[`javascript fixtures/modules/import-module.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 14, - ], - "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[`javascript fixtures/modules/import-named-as-specifier.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", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "baz": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 18, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "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[`javascript fixtures/modules/import-named-as-specifiers.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "baz": Object { - "$ref": 0, - }, - "xyz": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 18, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "xyz", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 23, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "xyz", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - ], - "name": "xyz", - "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[`javascript fixtures/modules/import-named-empty.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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/modules/import-named-specifier.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "bar": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 11, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 24, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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[`javascript fixtures/modules/import-named-specifiers.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "bar": Object { - "$ref": 0, - }, - "baz": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 11, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 16, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "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[`javascript fixtures/modules/import-named-specifiers-comma.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "bar": Object { - "$ref": 0, - }, - "baz": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 11, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 30, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 16, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 30, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "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[`javascript fixtures/modules/import-namespace-specifier.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 15, - ], - "type": "ImportNamespaceSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 27, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "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[`javascript fixtures/modules/import-null-as-nil.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "nil": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "nil", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 20, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 33, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "nil", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - ], - "name": "nil", - "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[`javascript fixtures/modules/invalid-await.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "await": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "await", - "range": Array [ - 11, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 7, - 17, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "await", - "range": Array [ - 11, - 16, - ], - "type": "Identifier", - }, - ], - "name": "await", - "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[`javascript fixtures/modules/invalid-class.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 15, - 23, - ], - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/modules/invalid-export-named-default.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "default", - "range": Array [ - 8, - 15, - ], - "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[`javascript fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 21, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 10, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 20, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "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[`javascript fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-module-specifier.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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; - -exports[`javascript fixtures/newTarget/invalid-new-target.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 18, - ], - "type": "MetaProperty", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/newTarget/invalid-unknown-property.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 8, - 44, - ], - "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 [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 44, - ], - "type": "FunctionExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 4, - 5, - ], - "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": "f", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/newTarget/simple-new-target.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 41, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 41, - ], - "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": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 27, - 37, - ], - "type": "MetaProperty", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": 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": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 23, - 37, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 19, - 38, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 40, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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[`javascript fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "fn", - "range": Array [ - 0, - 2, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 28, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - 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[`javascript fixtures/objectLiteralComputedProperties/computed-and-identifier.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 [ - 3, - 4, - ], - "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[`javascript fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 9, - 14, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "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": 6, - "block": Object { - "range": Array [ - 23, - 29, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "v": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "v", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 23, - 29, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "v", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - ], - "name": "v", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "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": 8, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 28, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - 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[`javascript fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 26, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "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 [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 26, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 27, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; - -exports[`javascript fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; - -exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 3, - 4, - ], - "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[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 21, - ], - "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[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-method.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 [ - 7, - 20, - ], - "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": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "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, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 27, - 29, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 40, - 80, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "proto", - "range": Array [ - 54, - 59, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "proto", - "range": Array [ - 73, - 78, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "proto": Object { - "$ref": 0, - }, - "x": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 29, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 15, - 30, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - ], - "name": "proto", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 36, - 80, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 32, - 81, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 85, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 85, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 27, - 29, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 40, - 84, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "proto", - "range": Array [ - 56, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "proto", - "range": Array [ - 77, - 82, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "proto": Object { - "$ref": 0, - }, - "x": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 29, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 15, - 30, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - ], - "name": "proto", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 36, - 84, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 32, - 85, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 23, - 52, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 52, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 15, - 53, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 23, - 56, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 56, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 15, - 57, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 17, - 47, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 49, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 49, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 50, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 16, - 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": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 4, - 28, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "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, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 13, - 23, - ], - "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": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 4, - 25, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "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, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 13, - 23, - ], - "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": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 4, - 25, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "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, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 16, - 31, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "test": 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": "test", - "range": Array [ - 17, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 16, - 31, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 17, - 21, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 4, - 33, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 18, - 28, - ], - "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": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 4, - 30, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "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, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 19, - 49, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 51, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 51, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 52, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 36, - 65, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "get", - "range": Array [ - 51, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "set", - "range": Array [ - 60, - 63, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - "get": Object { - "$ref": 1, - }, - "set": Object { - "$ref": 2, - }, - "x": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - ], - "name": "set", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 65, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 28, - 66, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "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[`javascript fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/octalLiterals/legacy.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 7, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 7, - ], - "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[`javascript fixtures/octalLiterals/lowercase.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 7, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 7, - ], - "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[`javascript fixtures/octalLiterals/strict-uppercase.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 21, - ], - "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[`javascript fixtures/octalLiterals/uppercase.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 7, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 7, - ], - "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[`javascript fixtures/regex/regexp-simple.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 16, - ], - "type": "Literal", - }, - }, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 17, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 40, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 40, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 41, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 21, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/regexUFlag/regex-u-simple.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 16, - ], - "type": "Literal", - }, - }, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 17, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/regexYFlag/regexp-y-simple.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 16, - ], - "type": "Literal", - }, - }, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 17, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/restParams/basic-rest.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - "b": 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": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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[`javascript fixtures/restParams/class-constructor.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 25, - 41, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "foo": Object { - "$ref": 3, - }, - }, - "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": "foo", - "range": Array [ - 29, - 32, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 41, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 29, - 32, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/restParams/class-method.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 17, - 33, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 3, - }, - }, - "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": "bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 33, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 35, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 35, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/restParams/error-no-default.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 1, - }, - "b": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "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[`javascript fixtures/restParams/error-not-last.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 1, - }, - "b": Object { - "$ref": 2, - }, - "c": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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[`javascript fixtures/restParams/func-expression.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 8, - 26, - ], - "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 [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 26, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 26, - ], - "type": "FunctionExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 26, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 27, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/restParams/func-expression-multi.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 8, - 28, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "arguments": Object { - "$ref": 2, - }, - "b": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 28, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 28, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 28, - ], - "type": "FunctionExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/restParams/invalid-rest-param.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "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 [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "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[`javascript fixtures/restParams/single-rest.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 [ - 0, - 19, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "b": 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": "b", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 19, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 19, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "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[`javascript fixtures/simple-literals/literal-float.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 13, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 14, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/simple-literals/literal-float-negative.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 14, - ], - "type": "UnaryExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/simple-literals/literal-null.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 14, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/simple-literals/literal-number.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 12, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/simple-literals/literal-number-negative.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 12, - ], - "type": "UnaryExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 13, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/simple-literals/literal-string.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 13, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 14, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/simple-literals/literal-undefined.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": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "name": "undefined", - "range": Array [ - 10, - 19, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "undefined", - "range": Array [ - 10, - 19, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "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 [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 20, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - 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[`javascript fixtures/spread/complex-spread.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "ka", - "range": Array [ - 7, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "nested", - "range": Array [ - 14, - 20, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "other", - "range": Array [ - 27, - 32, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "nested2", - "range": Array [ - 48, - 55, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 62, - 63, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 71, - 72, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 77, - 78, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "rest2", - "range": Array [ - 85, - 90, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "rest", - "range": Array [ - 97, - 101, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "complex", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "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[`javascript fixtures/spread/error-invalid-if.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/spread/error-invalid-sequence.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/spread/multi-function-call.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 10, - 11, - ], - "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[`javascript fixtures/spread/not-final-param.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "func", - "range": Array [ - 0, - 4, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 11, - 12, - ], - "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[`javascript fixtures/spread/simple-function-call.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "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[`javascript fixtures/templateStrings/deeply-nested.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "raw", - "range": Array [ - 0, - 3, - ], - "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[`javascript fixtures/templateStrings/error-octal-literal.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 7, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 7, - ], - "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[`javascript fixtures/templateStrings/escape-characters.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "ts", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 39, - ], - "type": "TemplateLiteral", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "ts": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "ts", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 39, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 40, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "ts", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - ], - "name": "ts", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/templateStrings/expressions.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 [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 8, - 9, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 19, - 25, - ], - "type": "Literal", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 51, - 52, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 11, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "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[`javascript fixtures/templateStrings/multi-line-template-string.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 111, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 111, - ], - "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[`javascript fixtures/templateStrings/simple-template-string.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 5, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 5, - ], - "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[`javascript fixtures/templateStrings/single-dollar-sign.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "ts", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 9, - 12, - ], - "type": "TemplateLiteral", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "ts": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "ts", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 13, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "ts", - "range": Array [ - 4, - 6, - ], - "type": "Identifier", - }, - ], - "name": "ts", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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[`javascript fixtures/templateStrings/tagged-no-placeholders.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "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[`javascript fixtures/templateStrings/tagged-template-string.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 76, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 76, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "console", - "range": Array [ - 18, - 25, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "arguments", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "tag", - "range": Array [ - 44, - 47, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 55, - 56, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 71, - 72, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "tag": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "tag", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 43, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "tag", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "tag", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`javascript fixtures/unicodeCodePointEscapes/basic-string-literal.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 19, - ], - "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[`javascript fixtures/unicodeCodePointEscapes/complex-string-literal.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "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[`javascript fixtures/unicodeCodePointEscapes/invalid-empty-escape.src 1`] = `"Hexadecimal digit expected."`; - -exports[`javascript fixtures/unicodeCodePointEscapes/invalid-too-large-escape.src 1`] = `"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."`; diff --git a/packages/parser/tests/lib/__snapshots__/jsx.ts.snap b/packages/parser/tests/lib/__snapshots__/jsx.ts.snap deleted file mode 100644 index d45d40982a5..00000000000 --- a/packages/parser/tests/lib/__snapshots__/jsx.ts.snap +++ /dev/null @@ -1,1586 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`JSX useJSXTextNode: false fixtures/attributes.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "quz", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "rest", - "range": Array [ - 29, - 33, - ], - "type": "Identifier", - }, - "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[`JSX useJSXTextNode: false fixtures/element-keyword-name.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 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": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`JSX useJSXTextNode: false fixtures/embedded-comment.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 33, - ], - "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[`JSX useJSXTextNode: false fixtures/embedded-conditional.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 6, - 7, - ], - "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[`JSX useJSXTextNode: false fixtures/embedded-invalid-js-identifier.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 42, - ], - "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[`JSX useJSXTextNode: false fixtures/empty-placeholder.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 10, - ], - "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[`JSX useJSXTextNode: false fixtures/escape-patterns.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 84, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 84, - ], - "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[`JSX useJSXTextNode: false fixtures/invalid-attribute.src 1`] = `"'{' expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-attribute-missing-equals.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-broken-tag.src 1`] = `"Unterminated string literal."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-computed-end-tag-name.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-computed-string-end-tag-name.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-embedded-expression.src 1`] = `"'}' expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-leading-dot-tag-name.src 1`] = `"Expression expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-matching-placeholder-in-closing-tag.src 1`] = `"'>' expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-mismatched-closing-tag.src 1`] = `"Expected corresponding JSX closing tag for 'a'."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-mismatched-closing-tags.src 1`] = `"JSX element 'a' has no corresponding closing tag."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-mismatched-dot-tag-name.src 1`] = `"Expected corresponding JSX closing tag for 'a.b.c'."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-mismatched-namespace-tag.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-missing-closing-tag.src 1`] = `"JSX element 'a' has no corresponding closing tag."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-missing-closing-tag-attribute-placeholder.src 1`] = `"JSX element 'a' has no corresponding closing tag."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-missing-namespace-name.src 1`] = `"Expression expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-missing-namespace-value.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-missing-spread-operator.src 1`] = `"'...' expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-namespace-name-with-docts.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-no-common-parent.src 1`] = `"JSX expressions must have one parent element."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-no-common-parent-with-comment.src 1`] = `"JSX expressions must have one parent element."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-no-tag-name.src 1`] = `"Declaration or statement expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-placeholder-in-closing-tag.src 1`] = `"'>' expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-shorthand-fragment-no-closing.src 1`] = `"JSX fragment has no corresponding closing tag."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-trailing-dot-tag-name.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/invalid-unexpected-comma.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/japanese-characters.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 12, - ], - "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[`JSX useJSXTextNode: false fixtures/less-than-operator.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": "x", - "range": Array [ - 12, - 13, - ], - "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[`JSX useJSXTextNode: false fixtures/member-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 12, - ], - "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[`JSX useJSXTextNode: false fixtures/member-expression-private.src 1`] = `"Identifier expected."`; - -exports[`JSX useJSXTextNode: false fixtures/member-expression-this.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 46, - ], - "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[`JSX useJSXTextNode: false fixtures/multiple-blank-spaces.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 12, - ], - "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[`JSX useJSXTextNode: false fixtures/newslines-and-entities.src 1`] = `"Invalid character."`; - -exports[`JSX useJSXTextNode: false fixtures/self-closing-tag.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 6, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 6, - ], - "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[`JSX useJSXTextNode: false fixtures/self-closing-tag-inside-tag.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 25, - ], - "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[`JSX useJSXTextNode: false fixtures/self-closing-tag-with-newline.src 1`] = `"Invalid character."`; - -exports[`JSX useJSXTextNode: false fixtures/shorthand-fragment.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 6, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 6, - ], - "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[`JSX useJSXTextNode: false fixtures/shorthand-fragment-with-child.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 13, - ], - "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[`JSX useJSXTextNode: false fixtures/spread-child.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "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[`JSX useJSXTextNode: false fixtures/spread-operator-attribute-and-regular-attribute.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 [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "props", - "range": Array [ - 9, - 14, - ], - "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[`JSX useJSXTextNode: false fixtures/spread-operator-attributes.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": "props", - "range": Array [ - 9, - 14, - ], - "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[`JSX useJSXTextNode: false fixtures/tag-names-with-dots.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 12, - ], - "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[`JSX useJSXTextNode: false fixtures/tag-names-with-multi-dots.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 16, - ], - "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[`JSX useJSXTextNode: false fixtures/tag-names-with-multi-dots-multi.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", - }, - "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[`JSX useJSXTextNode: false fixtures/test-content.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 25, - ], - "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[`JSX useJSXTextNode: false fixtures/trailing-spread-operator-attribute.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "props", - "range": Array [ - 40, - 45, - ], - "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[`JSX useJSXTextNode: false fixtures/unknown-escape-pattern.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 24, - ], - "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[`JSX useJSXTextNode: true fixtures/self-closing-tag-inside-tag.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 25, - ], - "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[`JSX useJSXTextNode: true fixtures/test-content.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 25, - ], - "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 [], -} -`; diff --git a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap deleted file mode 100644 index 78db01bfd95..00000000000 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ /dev/null @@ -1,24059 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/535.ts 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 52, - ], - "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": "bar", - "range": Array [ - 45, - 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, - }, - "bar": 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": "bar", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "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 [ - 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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/abstract-class.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 69, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 69, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 68, - ], - "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 [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 68, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 15, - 16, - ], - "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 [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 68, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 15, - 16, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/class-implements.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 82, - ], - "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, - 82, - ], - "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, - 82, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/class-properties.ts 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 19, - 62, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 50, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 18, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 10, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "s", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-supper-type.ts 1`] = ` -Object { - "$id": 13, - "block": Object { - "range": Array [ - 0, - 117, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 117, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 40, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - Object { - "$id": 9, - "block": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo2": Object { - "$ref": 8, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - ], - "name": "Foo2", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - Object { - "$id": 11, - "block": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo3": Object { - "$ref": 10, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 10, - "defs": Array [ - Object { - "name": Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - ], - "name": "Foo3", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 69, - 72, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - "Foo2": Object { - "$ref": 1, - }, - "Foo3": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 40, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - ], - "name": "Foo2", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - ], - "name": "Foo3", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 110, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 110, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 54, - 56, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 71, - 73, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - ], - "name": "s1", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 107, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 107, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 51, - 53, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 68, - 70, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - ], - "name": "s1", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "subject", - "range": Array [ - 61, - 68, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "subject": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "subject", - "range": Array [ - 27, - 51, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "subject", - "range": Array [ - 27, - 51, - ], - "type": "Identifier", - }, - ], - "name": "subject", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "eachr": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eachr", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eachr", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - ], - "name": "eachr", - "references": Array [], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/declare-global.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [ - 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 [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-module.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 95, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 95, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 33, - 92, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 89, - 90, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "b": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 52, - 61, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 52, - 61, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 46, - 61, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 52, - 61, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 79, - 90, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 79, - 90, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 73, - 90, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 79, - 90, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 93, - 94, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "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 [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 11, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 15, - 59, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 40, - 57, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 59, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 59, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 15, - 81, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 40, - 79, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 63, - 75, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 79, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 63, - 75, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 81, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 81, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 15, - 69, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 40, - 67, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 49, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 67, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 49, - 53, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 69, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 69, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/decorators.ts 1`] = ` -Object { - "$id": 19, - "block": Object { - "range": Array [ - 0, - 198, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 18, - "block": Object { - "range": Array [ - 0, - 198, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "target": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "target", - "range": Array [ - 13, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 29, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "target", - "range": Array [ - 13, - 24, - ], - "type": "Identifier", - }, - ], - "name": "target", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - Object { - "$id": 11, - "block": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "propertyKey": Object { - "$ref": 9, - }, - "target": Object { - "$ref": 8, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - ], - "name": "target", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 9, - "defs": Array [ - Object { - "name": Object { - "name": "propertyKey", - "range": Array [ - 72, - 91, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "propertyKey", - "range": Array [ - 72, - 91, - ], - "type": "Identifier", - }, - ], - "name": "propertyKey", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 7, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - Object { - "$id": 17, - "block": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 16, - "block": Object { - "range": Array [ - 159, - 195, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 15, - }, - }, - "variableScope": Object { - "$ref": 16, - }, - "variables": Array [ - Object { - "$id": 15, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 16, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 13, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", - "range": Array [ - 122, - 125, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 14, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", - "range": Array [ - 147, - 150, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "C": Object { - "$ref": 12, - }, - }, - "variableScope": Object { - "$ref": 18, - }, - "variables": Array [ - Object { - "$id": 12, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 17, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 18, - }, - "identifier": Object { - "name": "dec", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 19, - }, - "variableMap": Object { - "C": Object { - "$ref": 2, - }, - "dec": Object { - "$ref": 0, - }, - "gec": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 18, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "dec", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 29, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "dec", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "dec", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - ], - "name": "gec", - "references": Array [ - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], - "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 18, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 19, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum.ts 1`] = ` -Object { - "$id": 15, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 13, - "block": Object { - "range": Array [ - 20, - 70, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 48, - 53, - ], - "type": "BinaryExpression", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 63, - 68, - ], - "type": "BinaryExpression", - }, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 63, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "B", - "range": Array [ - 67, - 68, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 9, - }, - ], - "type": "enum", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "A": Object { - "$ref": 3, - }, - "B": Object { - "$ref": 4, - }, - "C": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 33, - 38, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 53, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 59, - 68, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 19, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { - "E": Object { - "$ref": 1, - }, - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "E", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 70, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "E", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "E", - "references": Array [], - "scope": Object { - "$ref": 14, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 15, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum-string.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "BAR", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "BAR": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "BAR", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 26, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "BAR", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "BAR", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/export-as-namespace.ts 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 scope analysis sourceType: module tests/fixtures/scope-analysis/expression-as.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` -Object { - "$id": 15, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 48, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "e", - "range": Array [ - 60, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - Object { - "$id": 13, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 63, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - "c": Object { - "$ref": 2, - }, - "d": Object { - "$ref": 3, - }, - "e": Object { - "$ref": 4, - }, - "f": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "d", - "references": Array [ - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 18, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [ - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 13, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 15, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 101, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 101, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 6, - "block": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 5, - }, - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 58, - 68, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 58, - 68, - ], - "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 { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 35, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Decorator", - "range": Array [ - 37, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "config", - "range": Array [ - 47, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 35, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "config", - "range": Array [ - 47, - 53, - ], - "type": "Identifier", - }, - ], - "name": "config", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Test": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "Test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 110, - 114, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 110, - 114, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 114, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 110, - 114, - ], - "type": "Identifier", - }, - ], - "name": "a", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "TSImportEqualsDeclaration", - }, - "parent": null, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 16, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/interface-type.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 67, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 143, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 143, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 28, - 142, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "text", - "range": Array [ - 116, - 120, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "text", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 19, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - "text": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "text", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 20, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "text", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - ], - "name": "text", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 28, - 142, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 37, - 40, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/method-overload.ts 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "a": Object { - "$ref": 7, - }, - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 18, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 10, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "s", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/namespace.ts 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 24, - 56, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 47, - 48, - ], - "type": "Literal", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "a": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 43, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 37, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "N", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "N": Object { - "$ref": 1, - }, - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 11, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "N", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 56, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "N", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - ], - "name": "N", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/rest-element.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "args": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "args", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "args", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - ], - "name": "args", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "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": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-alias.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 103, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 103, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 4, - }, - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - ], - "name": "a", - "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": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 20, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 20, - 31, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - ], - "name": "C", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 32, - 38, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 18, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 37, - ], - "type": "JSXElement", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 37, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 38, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/typeof.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 27, - 40, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 46, - 61, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 46, - 47, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 165, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 165, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 24, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 76, - 79, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 95, - 98, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 125, - 128, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 140, - 143, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 159, - 162, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 24, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-return-type.ts 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "g", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "g": 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": "g", - "range": Array [ - 31, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "g", - "range": Array [ - 31, - 35, - ], - "type": "Identifier", - }, - ], - "name": "g", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "g": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "g", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "g", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "g", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` -Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 46, - 58, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 87, - 99, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 132, - 146, - ], - "type": "ArrayExpression", - }, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 123, - 126, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "element": Object { - "$ref": 3, - }, - "obj": Object { - "$ref": 0, - }, - "obj2": Object { - "$ref": 1, - }, - "value": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 58, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 23, - 58, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - ], - "name": "obj2", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 63, - 99, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 59, - 99, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - ], - "name": "value", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 104, - 146, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 100, - 146, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - ], - "name": "element", - "references": Array [ - Object { - "$ref": 9, - }, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 46, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "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": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-infer.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 147, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-intersection-type.src.ts 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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 35, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 46, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 46, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 46, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 47, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 46, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-plus.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 81, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 8, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 9, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 21, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 20, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic-nested.src.ts 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 { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-empty.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-optional.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "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": "x", - "range": Array [ - 4, - 44, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-rest.src.ts 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 { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 28, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-literal.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 22, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-operator.src.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 38, - ], - "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 [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 36, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 37, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-typeof.src.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 17, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-intersection.src.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "intersection": Object { - "$ref": 1, - }, - "precedence1": Object { - "$ref": 2, - }, - "precedence2": Object { - "$ref": 3, - }, - "union": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "union", - "range": Array [ - 4, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 36, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 37, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "union", - "range": Array [ - 4, - 36, - ], - "type": "Identifier", - }, - ], - "name": "union", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "intersection", - "range": Array [ - 42, - 71, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 71, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 38, - 72, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "intersection", - "range": Array [ - 42, - 71, - ], - "type": "Identifier", - }, - ], - "name": "intersection", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "precedence1", - "range": Array [ - 77, - 115, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 77, - 115, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 73, - 116, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "precedence1", - "range": Array [ - 77, - 115, - ], - "type": "Identifier", - }, - ], - "name": "precedence1", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "precedence2", - "range": Array [ - 121, - 159, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 121, - 159, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 117, - 160, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "precedence2", - "range": Array [ - 121, - 159, - ], - "type": "Identifier", - }, - ], - "name": "precedence2", - "references": Array [], - "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 scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "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 scope analysis sourceType: script tests/fixtures/scope-analysis/535.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 45, - 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, - }, - "bar": 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": "bar", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "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, - 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, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/abstract-class.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 69, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 68, - ], - "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 [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 68, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 68, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-implements.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 82, - ], - "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, - 82, - ], - "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": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "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, - 82, - ], - "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, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-properties.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 19, - 62, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 50, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 18, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 10, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "s", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-supper-type.ts 1`] = ` -Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 117, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 40, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - Object { - "$id": 9, - "block": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo2": Object { - "$ref": 8, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - ], - "name": "Foo2", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - Object { - "$id": 11, - "block": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo3": Object { - "$ref": 10, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 10, - "defs": Array [ - Object { - "name": Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - ], - "name": "Foo3", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 69, - 72, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - "Foo2": Object { - "$ref": 1, - }, - "Foo3": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 40, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - ], - "name": "Foo2", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - ], - "name": "Foo3", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 110, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 54, - 56, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 71, - 73, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - ], - "name": "s1", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 107, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 51, - 53, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 68, - 70, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - ], - "name": "s1", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "subject", - "range": Array [ - 61, - 68, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "subject": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "subject", - "range": Array [ - 27, - 51, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "subject", - "range": Array [ - 27, - 51, - ], - "type": "Identifier", - }, - ], - "name": "subject", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "eachr": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eachr", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eachr", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - ], - "name": "eachr", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-global.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-module.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 95, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 33, - 92, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 89, - 90, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "b": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 52, - 61, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 52, - 61, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 46, - 61, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 52, - 61, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 79, - 90, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 79, - 90, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 73, - 90, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 79, - 90, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 93, - 94, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "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 [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 11, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 15, - 59, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 40, - 57, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "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 [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 59, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 59, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 15, - 81, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 40, - 79, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 63, - 75, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 79, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 63, - 75, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 81, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 81, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 15, - 69, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 40, - 67, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 49, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 67, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 49, - 53, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 69, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 69, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorators.ts 1`] = ` -Object { - "$id": 18, - "block": Object { - "range": Array [ - 0, - 198, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "target": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "target", - "range": Array [ - 13, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 29, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "target", - "range": Array [ - 13, - 24, - ], - "type": "Identifier", - }, - ], - "name": "target", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - Object { - "$id": 11, - "block": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "propertyKey": Object { - "$ref": 9, - }, - "target": Object { - "$ref": 8, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - ], - "name": "target", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 9, - "defs": Array [ - Object { - "name": Object { - "name": "propertyKey", - "range": Array [ - 72, - 91, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "propertyKey", - "range": Array [ - 72, - 91, - ], - "type": "Identifier", - }, - ], - "name": "propertyKey", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 7, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - Object { - "$id": 17, - "block": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 16, - "block": Object { - "range": Array [ - 159, - 195, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 15, - }, - }, - "variableScope": Object { - "$ref": 16, - }, - "variables": Array [ - Object { - "$id": 15, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 16, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 13, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", - "range": Array [ - 122, - 125, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 14, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", - "range": Array [ - 147, - 150, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "C": Object { - "$ref": 12, - }, - }, - "variableScope": Object { - "$ref": 18, - }, - "variables": Array [ - Object { - "$id": 12, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 17, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 18, - }, - "identifier": Object { - "name": "dec", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { - "$ref": 2, - }, - "dec": Object { - "$ref": 0, - }, - "gec": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 18, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "dec", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 29, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "dec", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "dec", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - ], - "name": "gec", - "references": Array [ - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], - "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 18, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum.ts 1`] = ` -Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 13, - "block": Object { - "range": Array [ - 20, - 70, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 48, - 53, - ], - "type": "BinaryExpression", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 63, - 68, - ], - "type": "BinaryExpression", - }, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 63, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "B", - "range": Array [ - 67, - 68, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 9, - }, - ], - "type": "enum", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "A": Object { - "$ref": 3, - }, - "B": Object { - "$ref": 4, - }, - "C": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 33, - 38, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 53, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 59, - 68, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 19, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "E": Object { - "$ref": 1, - }, - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "E", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 70, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "E", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "E", - "references": Array [], - "scope": Object { - "$ref": 14, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum-string.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "BAR", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "BAR": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "BAR", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 26, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "BAR", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "BAR", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "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": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-as.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` -Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 48, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "e", - "range": Array [ - 60, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - Object { - "$id": 13, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 63, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - "c": Object { - "$ref": 2, - }, - "d": Object { - "$ref": 3, - }, - "e": Object { - "$ref": 4, - }, - "f": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "d", - "references": Array [ - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 18, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [ - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 13, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 101, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 6, - "block": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 5, - }, - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 58, - 68, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 58, - 68, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 35, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Decorator", - "range": Array [ - 37, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "config", - "range": Array [ - 47, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 35, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "config", - "range": Array [ - 47, - 53, - ], - "type": "Identifier", - }, - ], - "name": "config", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Test": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 110, - 114, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 110, - 114, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 114, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 110, - 114, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-equals.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "TSImportEqualsDeclaration", - }, - "parent": null, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/interface-type.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 143, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 28, - 142, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "text", - "range": Array [ - 116, - 120, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "text", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 19, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - "text": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "text", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 20, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "text", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - ], - "name": "text", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 28, - 142, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/method-overload.ts 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "a": Object { - "$ref": 7, - }, - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 18, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 10, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "s", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/namespace.ts 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 24, - 56, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 47, - 48, - ], - "type": "Literal", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "a": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 43, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 37, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "N", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "N": Object { - "$ref": 1, - }, - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 11, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "N", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 56, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "N", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - ], - "name": "N", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/rest-element.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "args": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "args", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "args", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - ], - "name": "args", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "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": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-alias.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 103, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 4, - }, - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - ], - "name": "a", - "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": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 20, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 20, - 31, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 32, - 38, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "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": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 18, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 37, - ], - "type": "JSXElement", - }, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 37, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 38, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 43, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 27, - 40, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 46, - 61, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 46, - 47, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 165, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 24, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 76, - 79, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 95, - 98, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 125, - 128, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 140, - 143, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 159, - 162, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 24, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-return-type.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "g", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "g": 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": "g", - "range": Array [ - 31, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "g", - "range": Array [ - 31, - 35, - ], - "type": "Identifier", - }, - ], - "name": "g", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "g": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "g", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "g", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "g", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 46, - 58, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 87, - 99, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 132, - 146, - ], - "type": "ArrayExpression", - }, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 123, - 126, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "element": Object { - "$ref": 3, - }, - "obj": Object { - "$ref": 0, - }, - "obj2": Object { - "$ref": 1, - }, - "value": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 58, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 23, - 58, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - ], - "name": "obj2", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 63, - 99, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 59, - 99, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - ], - "name": "value", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 104, - 146, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 100, - 146, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - ], - "name": "element", - "references": Array [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 46, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "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": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-infer.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 35, - ], - "type": "Identifier", - }, - ], - "name": "map", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 46, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - ], - "name": "map", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 46, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 46, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 47, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 46, - ], - "type": "Identifier", - }, - ], - "name": "map", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly-plus.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - ], - "name": "map", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 8, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 9, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference-generic.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 21, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 20, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference-generic-nested.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple-empty.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple-optional.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "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": "x", - "range": Array [ - 4, - 44, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple-rest.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 28, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-type-literal.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 22, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-type-operator.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 36, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 37, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-typeof.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 17, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-union-intersection.src.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "intersection": Object { - "$ref": 1, - }, - "precedence1": Object { - "$ref": 2, - }, - "precedence2": Object { - "$ref": 3, - }, - "union": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "union", - "range": Array [ - 4, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 36, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 37, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "union", - "range": Array [ - 4, - 36, - ], - "type": "Identifier", - }, - ], - "name": "union", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "intersection", - "range": Array [ - 42, - 71, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 71, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 38, - 72, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "intersection", - "range": Array [ - 42, - 71, - ], - "type": "Identifier", - }, - ], - "name": "intersection", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "precedence1", - "range": Array [ - 77, - 115, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 77, - 115, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 73, - 116, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "precedence1", - "range": Array [ - 77, - 115, - ], - "type": "Identifier", - }, - ], - "name": "precedence1", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "precedence2", - "range": Array [ - 121, - 159, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 121, - 159, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 117, - 160, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "precedence2", - "range": Array [ - 121, - 159, - ], - "type": "Identifier", - }, - ], - "name": "precedence2", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; diff --git a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap deleted file mode 100644 index f8e20c7ce80..00000000000 --- a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap +++ /dev/null @@ -1,355 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`TSX fixtures/generic-jsx-element.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": 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[`TSX fixtures/generic-jsx-member-expression-private.src 1`] = `"Identifier expected."`; - -exports[`TSX fixtures/generic-jsx-opening-element.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 46, - ], - "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[`TSX fixtures/react-typed-props.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 164, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 164, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 80, - 164, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "props", - "range": Array [ - 136, - 141, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "props": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "props", - "range": Array [ - 93, - 105, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 80, - 164, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "props", - "range": Array [ - 93, - 105, - ], - "type": "Identifier", - }, - ], - "name": "props", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "App": Object { - "$ref": 1, - }, - "React": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "React", - "range": Array [ - 12, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 17, - ], - "type": "ImportNamespaceSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 30, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "React", - "range": Array [ - 12, - 17, - ], - "type": "Identifier", - }, - ], - "name": "React", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "App", - "range": Array [ - 89, - 92, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 80, - 164, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "App", - "range": Array [ - 89, - 92, - ], - "type": "Identifier", - }, - ], - "name": "App", - "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 [], -} -`; diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap deleted file mode 100644 index 2999d0f6f67..00000000000 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ /dev/null @@ -1,54697 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`typescript fixtures/babylon-convergence/type-parameter-whitespace-loc.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, - 24, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 24, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/babylon-convergence/type-parameters.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": "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 42, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/abstract-class-with-abstract-constructor.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 [ - 7, - 68, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "AbstractSocket": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 68, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - ], - "name": "AbstractSocket", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "AbstractSocket": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 68, - ], - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/abstract-class-with-abstract-method.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 86, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 86, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 86, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "AbstractSocket": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 86, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - ], - "name": "AbstractSocket", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "AbstractSocket": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 86, - ], - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/abstract-class-with-abstract-properties.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 62, - ], - "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 [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "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 [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "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/abstract-class-with-abstract-readonly-property.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 66, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 66, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 65, - ], - "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 [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 65, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "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 [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 65, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "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/abstract-class-with-abstract-static-constructor.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 74, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 74, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 73, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "AbstractSocket": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 73, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - ], - "name": "AbstractSocket", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "AbstractSocket": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 73, - ], - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/abstract-class-with-declare-properties.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 230, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 230, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 229, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "AbstractDeclProps": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractDeclProps", - "range": Array [ - 15, - 32, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 229, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AbstractDeclProps", - "range": Array [ - 15, - 32, - ], - "type": "Identifier", - }, - ], - "name": "AbstractDeclProps", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "AbstractDeclProps": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractDeclProps", - "range": Array [ - 15, - 32, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 229, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AbstractDeclProps", - "range": Array [ - 15, - 32, - ], - "type": "Identifier", - }, - ], - "name": "AbstractDeclProps", - "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/abstract-class-with-optional-method.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 78, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "AbstractSocket": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 78, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, - ], - "name": "AbstractSocket", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "AbstractSocket": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -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/angle-bracket-type-assertion.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "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": 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/angle-bracket-type-assertion-arrow-function.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 22, - 42, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "n", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "n": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "n", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 42, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "n", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - ], - "name": "n", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "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", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "asserted2": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "asserted2", - "range": Array [ - 4, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 43, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 44, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "asserted2", - "range": Array [ - 4, - 13, - ], - "type": "Identifier", - }, - ], - "name": "asserted2", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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/arrow-function-with-optional-parameter.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 1, - 14, - ], - "type": "ArrowFunctionExpression", - }, - "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, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "k": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "k", - "range": Array [ - 2, - 4, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 14, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "k", - "range": Array [ - 2, - 4, - ], - "type": "Identifier", - }, - ], - "name": "k", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 33, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/async-function-expression.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 1, - 26, - ], - "type": "FunctionExpression", - }, - "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, - }, - "variableMap": Object { - "test": 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": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/async-function-with-var-declaration.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 97, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 97, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 96, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "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, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 85, - 93, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "bar": Object { - "$ref": 3, - }, - "foo": Object { - "$ref": 2, - }, - "fooBar": Object { - "$ref": 4, - }, - }, - "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": "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", - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 96, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - ], - "name": "test", - "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/await-without-async-function.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 64, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 64, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "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": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "bar": 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": "bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 42, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 19, - 43, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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, - 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, - }, - "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/call-signatures-with-generics.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 68, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 68, - ], - "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/cast-as-expression.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "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", - }, - "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, - }, - "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-multi-assign.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "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-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 [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 21, - ], - "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": 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/catch-clause-with-annotation.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 4, - 8, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 9, - 28, - ], - "type": "CatchClause", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 24, - 28, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "catch", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "e": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 16, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 28, - ], - "type": "CatchClause", - }, - "parent": null, - "type": "CatchClause", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 16, - 22, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 4, - "block": Object { - "range": Array [ - 34, - 38, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 39, - 62, - ], - "type": "CatchClause", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 58, - 62, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "catch", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "e": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 46, - 56, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 39, - 62, - ], - "type": "CatchClause", - }, - "parent": null, - "type": "CatchClause", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 46, - 56, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/catch-clause-with-invalid-annotation.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 4, - 8, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 9, - 31, - ], - "type": "CatchClause", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 27, - 31, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "catch", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "e": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 16, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 31, - ], - "type": "CatchClause", - }, - "parent": null, - "type": "CatchClause", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 16, - 25, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "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, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 19, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "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, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "B": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 19, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-multi-line-keyword-declare.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 8, - 18, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "B": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 18, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "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, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "B": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 8, - 18, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-accessibility-modifiers.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 174, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 174, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-constructor-and-modifier.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 74, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 74, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": 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, - 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, - }, - }, - ], - }, - ], - "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-constructor-and-return-type.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 73, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 73, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "ClassDeclaration", - }, - "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, - }, - }, - "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, - 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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": 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, - }, - }, - ], - }, - ], - "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-constructor-and-type-parameters.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "ClassDeclaration", - }, - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": 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, - 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, - }, - }, - ], - }, - ], - "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-declare-properties.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 271, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 271, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 270, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "DeclProps": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "DeclProps", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 270, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "DeclProps", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "DeclProps", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "DeclProps": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "DeclProps", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 270, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "DeclProps", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "DeclProps", - "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-definite-assignment.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 25, - ], - "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, - }, - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "X": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "X", - "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-export-parameter-properties.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 58, - ], - "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-extends-and-implements.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 80, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "ClassWithParentAndInterface": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 80, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - ], - "name": "ClassWithParentAndInterface", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "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": 5, - }, - "variableMap": Object { - "ClassWithParentAndInterface": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 80, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - ], - "name": "ClassWithParentAndInterface", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 32, - ], - "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 [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 32, - ], - "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": 3, - }, - }, - ], - }, - ], - "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, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 32, - ], - "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": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 45, - ], - "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 [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 45, - ], - "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": 3, - }, - }, - ], - }, - ], - "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, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 45, - ], - "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": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "ClassDeclaration", - }, - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "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": 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 [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "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": 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/class-with-generic-method-default.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 20, - 34, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 36, - ], - "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": 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 [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 36, - ], - "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": 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/class-with-implements.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "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, - 29, - ], - "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, - 29, - ], - "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-implements-and-extends.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 80, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "ClassWithParentAndInterface": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 80, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - ], - "name": "ClassWithParentAndInterface", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "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, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "ClassWithParentAndInterface": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 80, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - ], - "name": "ClassWithParentAndInterface", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 32, - ], - "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, - 32, - ], - "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, - 32, - ], - "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-implements-generic-multiple.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 35, - ], - "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, - 35, - ], - "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, - 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": 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, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 57, - ], - "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": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 57, - ], - "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": 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/class-with-mixin.src 1`] = ` -Object { - "$id": 15, - "block": Object { - "range": Array [ - 0, - 207, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 207, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 84, - ], - "type": "FunctionDeclaration", - }, - "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 [], - }, - ], - "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, - }, - ], - "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 { - "name": Object { - "name": "Base", - "range": Array [ - 38, - 45, - ], - "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, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 136, - 137, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 13, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$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": 14, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "M", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 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", - }, - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 15, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Base": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "Base", - "range": Array [ - 37, - 44, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Base", - "range": Array [ - 37, - 44, - ], - "type": "Identifier", - }, - ], - "name": "Base", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "M": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "M", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "M", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "M", - "references": Array [], - "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/class-with-optional-computed-method.src 1`] = ` -Object { - "$id": 25, - "block": Object { - "range": Array [ - 0, - 282, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 24, - "block": Object { - "range": Array [ - 0, - 282, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 23, - "block": Object { - "range": Array [ - 111, - 281, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 14, - "block": Object { - "range": Array [ - 153, - 158, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 23, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 13, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 13, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 14, - }, - }, - ], - }, - Object { - "$id": 16, - "block": Object { - "range": Array [ - 176, - 181, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 23, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 15, - }, - }, - "variableScope": Object { - "$ref": 16, - }, - "variables": Array [ - Object { - "$id": 15, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 16, - }, - }, - ], - }, - Object { - "$id": 18, - "block": Object { - "range": Array [ - 217, - 222, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 23, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 17, - }, - }, - "variableScope": Object { - "$ref": 18, - }, - "variables": Array [ - Object { - "$id": 17, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 18, - }, - }, - ], - }, - Object { - "$id": 20, - "block": Object { - "range": Array [ - 239, - 244, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 23, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 19, - }, - }, - "variableScope": Object { - "$ref": 20, - }, - "variables": Array [ - Object { - "$id": 19, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 20, - }, - }, - ], - }, - Object { - "$id": 22, - "block": Object { - "range": Array [ - 274, - 279, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 23, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 21, - }, - }, - "variableScope": Object { - "$ref": 22, - }, - "variables": Array [ - Object { - "$id": 21, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 22, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 8, - "from": Object { - "$ref": 23, - }, - "identifier": Object { - "name": "computed1", - "range": Array [ - 124, - 133, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 23, - }, - "identifier": Object { - "name": "computed2", - "range": Array [ - 142, - 151, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 23, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 227, - 230, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 23, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 249, - 252, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 23, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 269, - 270, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, - Object { - "$ref": 12, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 24, - }, - "variableMap": Object { - "X": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 24, - }, - "variables": Array [ - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 117, - 118, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 111, - 281, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 117, - 118, - ], - "type": "Identifier", - }, - ], - "name": "X", - "references": Array [], - "scope": Object { - "$ref": 23, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 24, - }, - "identifier": Object { - "name": "computed1", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 24, - ], - "type": "Literal", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 24, - }, - "identifier": Object { - "name": "computed2", - "range": Array [ - 32, - 41, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 44, - 50, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 24, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 64, - 109, - ], - "type": "ObjectExpression", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 12, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 25, - }, - "variableMap": Object { - "X": Object { - "$ref": 3, - }, - "computed1": Object { - "$ref": 0, - }, - "computed2": Object { - "$ref": 1, - }, - "obj": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 24, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "computed1", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 25, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "computed1", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "computed1", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 24, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "computed2", - "range": Array [ - 32, - 41, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 50, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 26, - 51, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "computed2", - "range": Array [ - 32, - 41, - ], - "type": "Identifier", - }, - ], - "name": "computed2", - "references": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 24, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 109, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 52, - 110, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 24, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 117, - 118, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 111, - 281, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 117, - 118, - ], - "type": "Identifier", - }, - ], - "name": "X", - "references": Array [], - "scope": Object { - "$ref": 24, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 12, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 25, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "undefined", - "range": Array [ - 33, - 42, - ], - "type": "Identifier", - }, - "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 { - "name": Object { - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 45, - ], - "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": 3, - }, - }, - ], - }, - ], - "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", - }, - "node": Object { - "range": Array [ - 0, - 45, - ], - "type": "ClassDeclaration", - }, - "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": 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, - 67, - ], - "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, - 67, - ], - "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-optional-properties.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 219, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 219, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 51, - 218, - ], - "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, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 57, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 51, - 218, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 57, - 60, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "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": 10, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 2, - }, - "computed": Object { - "$ref": 0, - }, - "computed2": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "computed", - "range": Array [ - 6, - 14, - ], - "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, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 57, - 60, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "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/class-with-optional-property-undefined.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 41, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 41, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 39, - ], - "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, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "X": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 39, - ], - "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": 3, - }, - }, - ], - }, - ], - "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", - }, - "node": Object { - "range": Array [ - 0, - 39, - ], - "type": "ClassDeclaration", - }, - "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-private-parameter-properties.src 1`] = ` -Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 203, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 203, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 203, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 25, - 201, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "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": 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 [ - 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": 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, - ], - "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, - 203, - ], - "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-property-function.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 86, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 86, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 85, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 35, - 54, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - Object { - "$id": 4, - "block": Object { - "range": Array [ - 72, - 82, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$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 [ - Object { - "$ref": 3, - }, - ], - "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, - 85, - ], - "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 [ - Object { - "$ref": 3, - }, - ], - "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, - 85, - ], - "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 [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-property-values.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "ClassDeclaration", - }, - "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", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "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": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "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": 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-protected-parameter-properties.src 1`] = ` -Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 211, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 211, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 211, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 25, - 209, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "age", - "range": Array [ - 130, - 141, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 144, - 146, - ], - "type": "Literal", - }, - }, - 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", - }, - }, - ], - "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 [ - 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": 8, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/directive-in-module.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 11, - 59, - ], - "type": "TSModuleBlock", - }, - "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, - }, - "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": "foo", - "range": Array [ - 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, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 31, - 41, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 35, - 36, - ], - "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/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": 3, - "block": Object { - "range": Array [ - 14, - 62, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "type": "Literal", - }, - }, - ], - "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": "foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "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", - }, - "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, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 7, - 54, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "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 [ - 36, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 36, - 43, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "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 [ - 49, - 52, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 49, - 52, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 49, - 52, - ], - "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 [ - 26, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 54, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 26, - 29, - ], - "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-declare-named-enum.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 7, - 48, - ], - "type": "TSEnumDeclaration", - }, - "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", - }, - }, - ], - "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 [ - 30, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 30, - 37, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 30, - 33, - ], - "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 [ - 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": 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 [ - 20, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 48, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 20, - 23, - ], - "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-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, - "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", - }, - "childScopes": 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, - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/export-default-interface.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/export-named-class-with-generic.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 25, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 24, - ], - "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 [ - 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 { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "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 [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 27, - ], - "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 [ - 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": 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": 4, - "block": Object { - "range": Array [ - 7, - 40, - ], - "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, - }, - }, - "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, - }, - }, - ], - }, - ], - "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 [ - 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-named-enum-computed-number.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 7, - 28, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "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 { - "name": Object { - "name": "Foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 28, - ], - "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": 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/export-named-enum-computed-string.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 7, - 32, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "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 { - "name": Object { - "name": "Foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 32, - ], - "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": 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/export-named-enum-computed-var-ref.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 28, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 25, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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 [ - 12, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 28, - ], - "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": 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-star-as-ns-from.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "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-type.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "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-type-as.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 14, - 15, - ], - "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-type-from.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 32, - ], - "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-from-as.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/export-type-star-from.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 26, - ], - "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/function-anonymus-with-type-parameters.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 10, - 49, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 23, - 32, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 10, - 49, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 23, - 32, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "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", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 49, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 50, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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/function-anynomus-with-return-type.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 10, - 31, - ], - "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 [ - Object { - "$id": 1, - "from": 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", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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/function-overloads.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "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, - }, - }, - ], - }, - Object { - "$id": 8, - "block": Object { - "range": Array [ - 83, - 146, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 142, - 143, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 6, - }, - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/function-with-await.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "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, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "future": 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": "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "hope": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "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, - }, - }, - ], - }, - ], - "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-object-type-with-optional-properties.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 52, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 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, - }, - }, - ], - }, - ], - "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-object-type-without-annotation.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 50, - ], - "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, - }, - }, - ], - }, - ], - "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 [ - 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, - }, - }, - ], - }, - ], - "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-type-parameters.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 41, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 41, - ], - "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, - }, - }, - ], - }, - ], - "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, - 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, - }, - }, - ], - }, - ], - "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-type-parameters-that-have-comments.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 35, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "compare": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 52, - ], - "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, - }, - }, - ], - }, - ], - "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, - }, - }, - ], - }, - ], - "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.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "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": 6, - }, - "variableMap": Object { - "message": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "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, - "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 [ - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "age", - "range": Array [ - 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": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "age": Object { - "$ref": 3, - }, - "args": Object { - "$ref": 4, - }, - "arguments": Object { - "$ref": 1, - }, - "name": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "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": 7, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "args", - "range": Array [ - 51, - 55, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 96, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "args", - "range": Array [ - 51, - 55, - ], - "type": "Identifier", - }, - ], - "name": "args", - "references": Array [], - "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", - }, - "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, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "abc": Object { - "$ref": 0, - }, - "answer": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "abc", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 26, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 22, - 36, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "abc", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - ], - "name": "abc", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$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, - }, - }, - ], - }, - ], - "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, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSImportEqualsDeclaration", - }, - "parent": null, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "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-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 { - "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 { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "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-default.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 15, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 27, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "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-empty.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 55, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 55, - 81, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "type": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "type", - "range": Array [ - 62, - 66, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 62, - 66, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 55, - 80, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "type", - "range": Array [ - 62, - 66, - ], - "type": "Identifier", - }, - ], - "name": "type", - "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-error.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "bar": Object { - "$ref": 1, - }, - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 15, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 22, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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/import-type-named.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "bar": Object { - "$ref": 1, - }, - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 17, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 22, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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/import-type-named-as.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "bar": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 24, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 38, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "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-star-as-ns.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 35, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 20, - ], - "type": "ImportNamespaceSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 17, - 20, - ], - "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/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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 269, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 269, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "bax", - "range": Array [ - 56, - 59, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 75, - 78, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "loo", - "range": Array [ - 164, - 167, - ], - "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": 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-type-parameters.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/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": 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", - }, - "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-method.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, - }, - "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-optional-properties.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 82, - ], - "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-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": 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/keyof-operator.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "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/keyword-variables.src 1`] = ` -Object { - "$id": 108, - "block": Object { - "range": Array [ - 0, - 1078, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 107, - "block": Object { - "range": Array [ - 0, - 1078, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 94, - "block": Object { - "range": Array [ - 0, - 613, - ], - "type": "BlockStatement", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 63, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "abstract", - "range": Array [ - 10, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 32, - }, - "writeExpr": Object { - "range": Array [ - 21, - 22, - ], - "type": "Literal", - }, - }, - Object { - "$id": 64, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "as", - "range": Array [ - 32, - 34, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 33, - }, - "writeExpr": Object { - "range": Array [ - 37, - 38, - ], - "type": "Literal", - }, - }, - Object { - "$id": 65, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "asserts", - "range": Array [ - 48, - 55, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 34, - }, - "writeExpr": Object { - "range": Array [ - 58, - 59, - ], - "type": "Literal", - }, - }, - Object { - "$id": 66, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "any", - "range": Array [ - 69, - 72, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 35, - }, - "writeExpr": Object { - "range": Array [ - 75, - 76, - ], - "type": "Literal", - }, - }, - Object { - "$id": 67, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "async", - "range": Array [ - 86, - 91, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 36, - }, - "writeExpr": Object { - "range": Array [ - 94, - 95, - ], - "type": "Literal", - }, - }, - Object { - "$id": 68, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "await", - "range": Array [ - 105, - 110, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 37, - }, - "writeExpr": Object { - "range": Array [ - 113, - 114, - ], - "type": "Literal", - }, - }, - Object { - "$id": 69, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "boolean", - "range": Array [ - 124, - 131, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 38, - }, - "writeExpr": Object { - "range": Array [ - 134, - 135, - ], - "type": "Literal", - }, - }, - Object { - "$id": 70, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "constructor", - "range": Array [ - 145, - 156, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 39, - }, - "writeExpr": Object { - "range": Array [ - 159, - 160, - ], - "type": "Literal", - }, - }, - Object { - "$id": 71, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "declare", - "range": Array [ - 170, - 177, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 40, - }, - "writeExpr": Object { - "range": Array [ - 180, - 181, - ], - "type": "Literal", - }, - }, - Object { - "$id": 72, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "get", - "range": Array [ - 191, - 194, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 41, - }, - "writeExpr": Object { - "range": Array [ - 197, - 198, - ], - "type": "Literal", - }, - }, - Object { - "$id": 73, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "infer", - "range": Array [ - 208, - 213, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 42, - }, - "writeExpr": Object { - "range": Array [ - 216, - 217, - ], - "type": "Literal", - }, - }, - Object { - "$id": 74, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "is", - "range": Array [ - 227, - 229, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 43, - }, - "writeExpr": Object { - "range": Array [ - 232, - 233, - ], - "type": "Literal", - }, - }, - Object { - "$id": 75, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "keyof", - "range": Array [ - 243, - 248, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 44, - }, - "writeExpr": Object { - "range": Array [ - 251, - 252, - ], - "type": "Literal", - }, - }, - Object { - "$id": 76, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "module", - "range": Array [ - 262, - 268, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 45, - }, - "writeExpr": Object { - "range": Array [ - 271, - 272, - ], - "type": "Literal", - }, - }, - Object { - "$id": 77, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "namespace", - "range": Array [ - 282, - 291, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 46, - }, - "writeExpr": Object { - "range": Array [ - 294, - 295, - ], - "type": "Literal", - }, - }, - Object { - "$id": 78, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "never", - "range": Array [ - 305, - 310, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 47, - }, - "writeExpr": Object { - "range": Array [ - 313, - 314, - ], - "type": "Literal", - }, - }, - Object { - "$id": 79, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "readonly", - "range": Array [ - 324, - 332, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 48, - }, - "writeExpr": Object { - "range": Array [ - 335, - 336, - ], - "type": "Literal", - }, - }, - Object { - "$id": 80, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "require", - "range": Array [ - 346, - 353, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 49, - }, - "writeExpr": Object { - "range": Array [ - 356, - 357, - ], - "type": "Literal", - }, - }, - Object { - "$id": 81, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "number", - "range": Array [ - 367, - 373, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 50, - }, - "writeExpr": Object { - "range": Array [ - 376, - 377, - ], - "type": "Literal", - }, - }, - Object { - "$id": 82, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "object", - "range": Array [ - 387, - 393, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 51, - }, - "writeExpr": Object { - "range": Array [ - 396, - 397, - ], - "type": "Literal", - }, - }, - Object { - "$id": 83, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "set", - "range": Array [ - 407, - 410, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 52, - }, - "writeExpr": Object { - "range": Array [ - 413, - 414, - ], - "type": "Literal", - }, - }, - Object { - "$id": 84, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "string", - "range": Array [ - 424, - 430, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 53, - }, - "writeExpr": Object { - "range": Array [ - 433, - 434, - ], - "type": "Literal", - }, - }, - Object { - "$id": 85, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "symbol", - "range": Array [ - 444, - 450, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 54, - }, - "writeExpr": Object { - "range": Array [ - 453, - 454, - ], - "type": "Literal", - }, - }, - Object { - "$id": 86, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "type", - "range": Array [ - 464, - 468, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 55, - }, - "writeExpr": Object { - "range": Array [ - 471, - 472, - ], - "type": "Literal", - }, - }, - Object { - "$id": 87, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "undefined", - "range": Array [ - 482, - 491, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 56, - }, - "writeExpr": Object { - "range": Array [ - 494, - 495, - ], - "type": "Literal", - }, - }, - Object { - "$id": 88, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "unique", - "range": Array [ - 505, - 511, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 57, - }, - "writeExpr": Object { - "range": Array [ - 514, - 515, - ], - "type": "Literal", - }, - }, - Object { - "$id": 89, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "unknown", - "range": Array [ - 525, - 532, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 58, - }, - "writeExpr": Object { - "range": Array [ - 535, - 536, - ], - "type": "Literal", - }, - }, - Object { - "$id": 90, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "from", - "range": Array [ - 546, - 550, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 59, - }, - "writeExpr": Object { - "range": Array [ - 553, - 554, - ], - "type": "Literal", - }, - }, - Object { - "$id": 91, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "global", - "range": Array [ - 564, - 570, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 60, - }, - "writeExpr": Object { - "range": Array [ - 573, - 574, - ], - "type": "Literal", - }, - }, - Object { - "$id": 92, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "bigint", - "range": Array [ - 584, - 590, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 61, - }, - "writeExpr": Object { - "range": Array [ - 593, - 594, - ], - "type": "Literal", - }, - }, - Object { - "$id": 93, - "from": Object { - "$ref": 94, - }, - "identifier": Object { - "name": "of", - "range": Array [ - 604, - 606, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 62, - }, - "writeExpr": Object { - "range": Array [ - 609, - 610, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 107, - }, - "variableMap": Object { - "abstract": Object { - "$ref": 32, - }, - "any": Object { - "$ref": 35, - }, - "as": Object { - "$ref": 33, - }, - "asserts": Object { - "$ref": 34, - }, - "async": Object { - "$ref": 36, - }, - "await": Object { - "$ref": 37, - }, - "bigint": Object { - "$ref": 61, - }, - "boolean": Object { - "$ref": 38, - }, - "constructor": Object { - "$ref": 39, - }, - "declare": Object { - "$ref": 40, - }, - "from": Object { - "$ref": 59, - }, - "get": Object { - "$ref": 41, - }, - "global": Object { - "$ref": 60, - }, - "infer": Object { - "$ref": 42, - }, - "is": Object { - "$ref": 43, - }, - "keyof": Object { - "$ref": 44, - }, - "module": Object { - "$ref": 45, - }, - "namespace": Object { - "$ref": 46, - }, - "never": Object { - "$ref": 47, - }, - "number": Object { - "$ref": 50, - }, - "object": Object { - "$ref": 51, - }, - "of": Object { - "$ref": 62, - }, - "readonly": Object { - "$ref": 48, - }, - "require": Object { - "$ref": 49, - }, - "set": Object { - "$ref": 52, - }, - "string": Object { - "$ref": 53, - }, - "symbol": Object { - "$ref": 54, - }, - "type": Object { - "$ref": 55, - }, - "undefined": Object { - "$ref": 56, - }, - "unique": Object { - "$ref": 57, - }, - "unknown": Object { - "$ref": 58, - }, - }, - "variableScope": Object { - "$ref": 107, - }, - "variables": Array [ - Object { - "$id": 32, - "defs": Array [ - Object { - "name": Object { - "name": "abstract", - "range": Array [ - 10, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 10, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 4, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "abstract", - "range": Array [ - 10, - 18, - ], - "type": "Identifier", - }, - ], - "name": "abstract", - "references": Array [ - Object { - "$ref": 63, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 33, - "defs": Array [ - Object { - "name": Object { - "name": "as", - "range": Array [ - 32, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 38, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 26, - 39, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "as", - "range": Array [ - 32, - 34, - ], - "type": "Identifier", - }, - ], - "name": "as", - "references": Array [ - Object { - "$ref": 64, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 34, - "defs": Array [ - Object { - "name": Object { - "name": "asserts", - "range": Array [ - 48, - 55, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 48, - 59, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 42, - 60, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "asserts", - "range": Array [ - 48, - 55, - ], - "type": "Identifier", - }, - ], - "name": "asserts", - "references": Array [ - Object { - "$ref": 65, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 35, - "defs": Array [ - Object { - "name": Object { - "name": "any", - "range": Array [ - 69, - 72, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 69, - 76, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 63, - 77, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "any", - "range": Array [ - 69, - 72, - ], - "type": "Identifier", - }, - ], - "name": "any", - "references": Array [ - Object { - "$ref": 66, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 36, - "defs": Array [ - Object { - "name": Object { - "name": "async", - "range": Array [ - 86, - 91, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 86, - 95, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 80, - 96, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "async", - "range": Array [ - 86, - 91, - ], - "type": "Identifier", - }, - ], - "name": "async", - "references": Array [ - Object { - "$ref": 67, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 37, - "defs": Array [ - Object { - "name": Object { - "name": "await", - "range": Array [ - 105, - 110, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 105, - 114, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 99, - 115, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "await", - "range": Array [ - 105, - 110, - ], - "type": "Identifier", - }, - ], - "name": "await", - "references": Array [ - Object { - "$ref": 68, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 38, - "defs": Array [ - Object { - "name": Object { - "name": "boolean", - "range": Array [ - 124, - 131, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 124, - 135, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 118, - 136, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "boolean", - "range": Array [ - 124, - 131, - ], - "type": "Identifier", - }, - ], - "name": "boolean", - "references": Array [ - Object { - "$ref": 69, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 39, - "defs": Array [ - Object { - "name": Object { - "name": "constructor", - "range": Array [ - 145, - 156, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 145, - 160, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 139, - 161, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "constructor", - "range": Array [ - 145, - 156, - ], - "type": "Identifier", - }, - ], - "name": "constructor", - "references": Array [ - Object { - "$ref": 70, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 40, - "defs": Array [ - Object { - "name": Object { - "name": "declare", - "range": Array [ - 170, - 177, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 170, - 181, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 164, - 182, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "declare", - "range": Array [ - 170, - 177, - ], - "type": "Identifier", - }, - ], - "name": "declare", - "references": Array [ - Object { - "$ref": 71, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 41, - "defs": Array [ - Object { - "name": Object { - "name": "get", - "range": Array [ - 191, - 194, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 191, - 198, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 185, - 199, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 191, - 194, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [ - Object { - "$ref": 72, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 42, - "defs": Array [ - Object { - "name": Object { - "name": "infer", - "range": Array [ - 208, - 213, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 208, - 217, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 202, - 218, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "infer", - "range": Array [ - 208, - 213, - ], - "type": "Identifier", - }, - ], - "name": "infer", - "references": Array [ - Object { - "$ref": 73, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 43, - "defs": Array [ - Object { - "name": Object { - "name": "is", - "range": Array [ - 227, - 229, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 227, - 233, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 221, - 234, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "is", - "range": Array [ - 227, - 229, - ], - "type": "Identifier", - }, - ], - "name": "is", - "references": Array [ - Object { - "$ref": 74, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 44, - "defs": Array [ - Object { - "name": Object { - "name": "keyof", - "range": Array [ - 243, - 248, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 243, - 252, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 237, - 253, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "keyof", - "range": Array [ - 243, - 248, - ], - "type": "Identifier", - }, - ], - "name": "keyof", - "references": Array [ - Object { - "$ref": 75, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 45, - "defs": Array [ - Object { - "name": Object { - "name": "module", - "range": Array [ - 262, - 268, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 262, - 272, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 256, - 273, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "module", - "range": Array [ - 262, - 268, - ], - "type": "Identifier", - }, - ], - "name": "module", - "references": Array [ - Object { - "$ref": 76, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 46, - "defs": Array [ - Object { - "name": Object { - "name": "namespace", - "range": Array [ - 282, - 291, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 282, - 295, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 276, - 296, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "namespace", - "range": Array [ - 282, - 291, - ], - "type": "Identifier", - }, - ], - "name": "namespace", - "references": Array [ - Object { - "$ref": 77, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 47, - "defs": Array [ - Object { - "name": Object { - "name": "never", - "range": Array [ - 305, - 310, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 305, - 314, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 299, - 315, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "never", - "range": Array [ - 305, - 310, - ], - "type": "Identifier", - }, - ], - "name": "never", - "references": Array [ - Object { - "$ref": 78, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 48, - "defs": Array [ - Object { - "name": Object { - "name": "readonly", - "range": Array [ - 324, - 332, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 324, - 336, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 318, - 337, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "readonly", - "range": Array [ - 324, - 332, - ], - "type": "Identifier", - }, - ], - "name": "readonly", - "references": Array [ - Object { - "$ref": 79, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 49, - "defs": Array [ - Object { - "name": Object { - "name": "require", - "range": Array [ - 346, - 353, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 346, - 357, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 340, - 358, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "require", - "range": Array [ - 346, - 353, - ], - "type": "Identifier", - }, - ], - "name": "require", - "references": Array [ - Object { - "$ref": 80, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 50, - "defs": Array [ - Object { - "name": Object { - "name": "number", - "range": Array [ - 367, - 373, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 367, - 377, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 361, - 378, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "number", - "range": Array [ - 367, - 373, - ], - "type": "Identifier", - }, - ], - "name": "number", - "references": Array [ - Object { - "$ref": 81, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 51, - "defs": Array [ - Object { - "name": Object { - "name": "object", - "range": Array [ - 387, - 393, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 387, - 397, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 381, - 398, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "object", - "range": Array [ - 387, - 393, - ], - "type": "Identifier", - }, - ], - "name": "object", - "references": Array [ - Object { - "$ref": 82, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 52, - "defs": Array [ - Object { - "name": Object { - "name": "set", - "range": Array [ - 407, - 410, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 407, - 414, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 401, - 415, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 407, - 410, - ], - "type": "Identifier", - }, - ], - "name": "set", - "references": Array [ - Object { - "$ref": 83, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 53, - "defs": Array [ - Object { - "name": Object { - "name": "string", - "range": Array [ - 424, - 430, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 424, - 434, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 418, - 435, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "string", - "range": Array [ - 424, - 430, - ], - "type": "Identifier", - }, - ], - "name": "string", - "references": Array [ - Object { - "$ref": 84, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 54, - "defs": Array [ - Object { - "name": Object { - "name": "symbol", - "range": Array [ - 444, - 450, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 444, - 454, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 438, - 455, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "symbol", - "range": Array [ - 444, - 450, - ], - "type": "Identifier", - }, - ], - "name": "symbol", - "references": Array [ - Object { - "$ref": 85, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 55, - "defs": Array [ - Object { - "name": Object { - "name": "type", - "range": Array [ - 464, - 468, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 464, - 472, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 458, - 473, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "type", - "range": Array [ - 464, - 468, - ], - "type": "Identifier", - }, - ], - "name": "type", - "references": Array [ - Object { - "$ref": 86, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 56, - "defs": Array [ - Object { - "name": Object { - "name": "undefined", - "range": Array [ - 482, - 491, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 482, - 495, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 476, - 496, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "undefined", - "range": Array [ - 482, - 491, - ], - "type": "Identifier", - }, - ], - "name": "undefined", - "references": Array [ - Object { - "$ref": 87, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 57, - "defs": Array [ - Object { - "name": Object { - "name": "unique", - "range": Array [ - 505, - 511, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 505, - 515, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 499, - 516, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "unique", - "range": Array [ - 505, - 511, - ], - "type": "Identifier", - }, - ], - "name": "unique", - "references": Array [ - Object { - "$ref": 88, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 58, - "defs": Array [ - Object { - "name": Object { - "name": "unknown", - "range": Array [ - 525, - 532, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 525, - 536, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 519, - 537, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "unknown", - "range": Array [ - 525, - 532, - ], - "type": "Identifier", - }, - ], - "name": "unknown", - "references": Array [ - Object { - "$ref": 89, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 59, - "defs": Array [ - Object { - "name": Object { - "name": "from", - "range": Array [ - 546, - 550, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 546, - 554, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 540, - 555, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "from", - "range": Array [ - 546, - 550, - ], - "type": "Identifier", - }, - ], - "name": "from", - "references": Array [ - Object { - "$ref": 90, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 60, - "defs": Array [ - Object { - "name": Object { - "name": "global", - "range": Array [ - 564, - 570, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 564, - 574, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 558, - 575, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "global", - "range": Array [ - 564, - 570, - ], - "type": "Identifier", - }, - ], - "name": "global", - "references": Array [ - Object { - "$ref": 91, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 61, - "defs": Array [ - Object { - "name": Object { - "name": "bigint", - "range": Array [ - 584, - 590, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 584, - 594, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 578, - 595, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bigint", - "range": Array [ - 584, - 590, - ], - "type": "Identifier", - }, - ], - "name": "bigint", - "references": Array [ - Object { - "$ref": 92, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - Object { - "$id": 62, - "defs": Array [ - Object { - "name": Object { - "name": "of", - "range": Array [ - 604, - 606, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 604, - 610, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 598, - 611, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "of", - "range": Array [ - 604, - 606, - ], - "type": "Identifier", - }, - ], - "name": "of", - "references": Array [ - Object { - "$ref": 93, - }, - ], - "scope": Object { - "$ref": 94, - }, - }, - ], - }, - Object { - "$id": 106, - "block": Object { - "range": Array [ - 962, - 1077, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 97, - "block": Object { - "range": Array [ - 995, - 1000, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 106, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 96, - }, - }, - "variableScope": Object { - "$ref": 97, - }, - "variables": Array [ - Object { - "$id": 96, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 97, - }, - }, - ], - }, - Object { - "$id": 99, - "block": Object { - "range": Array [ - 1012, - 1017, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 106, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 98, - }, - }, - "variableScope": Object { - "$ref": 99, - }, - "variables": Array [ - Object { - "$id": 98, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 99, - }, - }, - ], - }, - Object { - "$id": 101, - "block": Object { - "range": Array [ - 1028, - 1033, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 106, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 100, - }, - }, - "variableScope": Object { - "$ref": 101, - }, - "variables": Array [ - Object { - "$id": 100, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 101, - }, - }, - ], - }, - Object { - "$id": 105, - "block": Object { - "range": Array [ - 1048, - 1075, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 104, - "from": Object { - "$ref": 105, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 1061, - 1062, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 103, - }, - "writeExpr": Object { - "range": Array [ - 1065, - 1070, - ], - "type": "YieldExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 106, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 102, - }, - "x": Object { - "$ref": 103, - }, - }, - "variableScope": Object { - "$ref": 105, - }, - "variables": Array [ - Object { - "$id": 102, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 105, - }, - }, - Object { - "$id": 103, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 1061, - 1062, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1061, - 1070, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 1057, - 1071, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 1061, - 1062, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 104, - }, - ], - "scope": Object { - "$ref": 105, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 107, - }, - "variableMap": Object { - "C": Object { - "$ref": 95, - }, - }, - "variableScope": Object { - "$ref": 107, - }, - "variables": Array [ - Object { - "$id": 95, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 968, - 969, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 962, - 1077, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 968, - 969, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 106, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 108, - }, - "variableMap": Object { - "C": Object { - "$ref": 31, - }, - "abstract": Object { - "$ref": 0, - }, - "any": Object { - "$ref": 3, - }, - "as": Object { - "$ref": 1, - }, - "asserts": Object { - "$ref": 2, - }, - "async": Object { - "$ref": 4, - }, - "await": Object { - "$ref": 5, - }, - "bigint": Object { - "$ref": 29, - }, - "boolean": Object { - "$ref": 6, - }, - "constructor": Object { - "$ref": 7, - }, - "declare": Object { - "$ref": 8, - }, - "from": Object { - "$ref": 27, - }, - "get": Object { - "$ref": 9, - }, - "global": Object { - "$ref": 28, - }, - "infer": Object { - "$ref": 10, - }, - "is": Object { - "$ref": 11, - }, - "keyof": Object { - "$ref": 12, - }, - "module": Object { - "$ref": 13, - }, - "namespace": Object { - "$ref": 14, - }, - "never": Object { - "$ref": 15, - }, - "number": Object { - "$ref": 18, - }, - "object": Object { - "$ref": 19, - }, - "of": Object { - "$ref": 30, - }, - "readonly": Object { - "$ref": 16, - }, - "require": Object { - "$ref": 17, - }, - "set": Object { - "$ref": 20, - }, - "string": Object { - "$ref": 21, - }, - "symbol": Object { - "$ref": 22, - }, - "type": Object { - "$ref": 23, - }, - "undefined": Object { - "$ref": 24, - }, - "unique": Object { - "$ref": 25, - }, - "unknown": Object { - "$ref": 26, - }, - }, - "variableScope": Object { - "$ref": 107, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "abstract", - "range": Array [ - 626, - 634, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 626, - 634, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "abstract", - "range": Array [ - 626, - 634, - ], - "type": "Identifier", - }, - ], - "name": "abstract", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "as", - "range": Array [ - 638, - 640, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 638, - 640, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "as", - "range": Array [ - 638, - 640, - ], - "type": "Identifier", - }, - ], - "name": "as", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "asserts", - "range": Array [ - 644, - 651, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 644, - 651, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "asserts", - "range": Array [ - 644, - 651, - ], - "type": "Identifier", - }, - ], - "name": "asserts", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "any", - "range": Array [ - 655, - 658, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 655, - 658, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "any", - "range": Array [ - 655, - 658, - ], - "type": "Identifier", - }, - ], - "name": "any", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "async", - "range": Array [ - 662, - 667, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 662, - 667, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "async", - "range": Array [ - 662, - 667, - ], - "type": "Identifier", - }, - ], - "name": "async", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "await", - "range": Array [ - 671, - 676, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 671, - 676, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "await", - "range": Array [ - 671, - 676, - ], - "type": "Identifier", - }, - ], - "name": "await", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "boolean", - "range": Array [ - 680, - 687, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 680, - 687, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "boolean", - "range": Array [ - 680, - 687, - ], - "type": "Identifier", - }, - ], - "name": "boolean", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "constructor", - "range": Array [ - 691, - 702, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 691, - 702, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "constructor", - "range": Array [ - 691, - 702, - ], - "type": "Identifier", - }, - ], - "name": "constructor", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "declare", - "range": Array [ - 706, - 713, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 706, - 713, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "declare", - "range": Array [ - 706, - 713, - ], - "type": "Identifier", - }, - ], - "name": "declare", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 9, - "defs": Array [ - Object { - "name": Object { - "name": "get", - "range": Array [ - 717, - 720, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 717, - 720, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 717, - 720, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 10, - "defs": Array [ - Object { - "name": Object { - "name": "infer", - "range": Array [ - 724, - 729, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 724, - 729, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "infer", - "range": Array [ - 724, - 729, - ], - "type": "Identifier", - }, - ], - "name": "infer", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 11, - "defs": Array [ - Object { - "name": Object { - "name": "is", - "range": Array [ - 733, - 735, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 733, - 735, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "is", - "range": Array [ - 733, - 735, - ], - "type": "Identifier", - }, - ], - "name": "is", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 12, - "defs": Array [ - Object { - "name": Object { - "name": "keyof", - "range": Array [ - 739, - 744, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 739, - 744, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "keyof", - "range": Array [ - 739, - 744, - ], - "type": "Identifier", - }, - ], - "name": "keyof", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 13, - "defs": Array [ - Object { - "name": Object { - "name": "module", - "range": Array [ - 748, - 754, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 748, - 754, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "module", - "range": Array [ - 748, - 754, - ], - "type": "Identifier", - }, - ], - "name": "module", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 14, - "defs": Array [ - Object { - "name": Object { - "name": "namespace", - "range": Array [ - 758, - 767, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 758, - 767, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "namespace", - "range": Array [ - 758, - 767, - ], - "type": "Identifier", - }, - ], - "name": "namespace", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 15, - "defs": Array [ - Object { - "name": Object { - "name": "never", - "range": Array [ - 771, - 776, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 771, - 776, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "never", - "range": Array [ - 771, - 776, - ], - "type": "Identifier", - }, - ], - "name": "never", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 16, - "defs": Array [ - Object { - "name": Object { - "name": "readonly", - "range": Array [ - 780, - 788, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 780, - 788, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "readonly", - "range": Array [ - 780, - 788, - ], - "type": "Identifier", - }, - ], - "name": "readonly", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 17, - "defs": Array [ - Object { - "name": Object { - "name": "require", - "range": Array [ - 792, - 799, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 792, - 799, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "require", - "range": Array [ - 792, - 799, - ], - "type": "Identifier", - }, - ], - "name": "require", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 18, - "defs": Array [ - Object { - "name": Object { - "name": "number", - "range": Array [ - 803, - 809, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 803, - 809, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "number", - "range": Array [ - 803, - 809, - ], - "type": "Identifier", - }, - ], - "name": "number", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 19, - "defs": Array [ - Object { - "name": Object { - "name": "object", - "range": Array [ - 813, - 819, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 813, - 819, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "object", - "range": Array [ - 813, - 819, - ], - "type": "Identifier", - }, - ], - "name": "object", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 20, - "defs": Array [ - Object { - "name": Object { - "name": "set", - "range": Array [ - 823, - 826, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 823, - 826, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 823, - 826, - ], - "type": "Identifier", - }, - ], - "name": "set", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 21, - "defs": Array [ - Object { - "name": Object { - "name": "string", - "range": Array [ - 830, - 836, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 830, - 836, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "string", - "range": Array [ - 830, - 836, - ], - "type": "Identifier", - }, - ], - "name": "string", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 22, - "defs": Array [ - Object { - "name": Object { - "name": "symbol", - "range": Array [ - 840, - 846, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 840, - 846, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "symbol", - "range": Array [ - 840, - 846, - ], - "type": "Identifier", - }, - ], - "name": "symbol", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 23, - "defs": Array [ - Object { - "name": Object { - "name": "type", - "range": Array [ - 850, - 854, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 850, - 854, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "type", - "range": Array [ - 850, - 854, - ], - "type": "Identifier", - }, - ], - "name": "type", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 24, - "defs": Array [ - Object { - "name": Object { - "name": "undefined", - "range": Array [ - 858, - 867, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 858, - 867, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "undefined", - "range": Array [ - 858, - 867, - ], - "type": "Identifier", - }, - ], - "name": "undefined", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 25, - "defs": Array [ - Object { - "name": Object { - "name": "unique", - "range": Array [ - 871, - 877, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 871, - 877, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "unique", - "range": Array [ - 871, - 877, - ], - "type": "Identifier", - }, - ], - "name": "unique", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 26, - "defs": Array [ - Object { - "name": Object { - "name": "unknown", - "range": Array [ - 881, - 888, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 881, - 888, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "unknown", - "range": Array [ - 881, - 888, - ], - "type": "Identifier", - }, - ], - "name": "unknown", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 27, - "defs": Array [ - Object { - "name": Object { - "name": "from", - "range": Array [ - 892, - 896, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 892, - 896, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "from", - "range": Array [ - 892, - 896, - ], - "type": "Identifier", - }, - ], - "name": "from", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 28, - "defs": Array [ - Object { - "name": Object { - "name": "global", - "range": Array [ - 900, - 906, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 900, - 906, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "global", - "range": Array [ - 900, - 906, - ], - "type": "Identifier", - }, - ], - "name": "global", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 29, - "defs": Array [ - Object { - "name": Object { - "name": "bigint", - "range": Array [ - 910, - 916, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 910, - 916, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bigint", - "range": Array [ - 910, - 916, - ], - "type": "Identifier", - }, - ], - "name": "bigint", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 30, - "defs": Array [ - Object { - "name": Object { - "name": "of", - "range": Array [ - 920, - 922, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 920, - 922, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 615, - 945, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "of", - "range": Array [ - 920, - 922, - ], - "type": "Identifier", - }, - ], - "name": "of", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - Object { - "$id": 31, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 968, - 969, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 962, - 1077, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 968, - 969, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 107, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 108, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 44, - ], - "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 [ - 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, - "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, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/new-target-in-arrow-function-body.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 10, - 26, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 26, - ], - "type": "ArrowFunctionExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "b": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 26, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 27, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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/non-null-assertion-operator.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "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 [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "processEntity": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "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 [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 30, - ], - "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 [ - 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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/nullish-coalescing.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "Program", - }, - "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": 8, - }, - "variableMap": Object { - "processNullishCoalesce": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "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 [], - "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": 6, - }, - "variableMap": Object { - "X": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` -Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 176, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 176, - ], - "type": "Program", - }, - "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 [ - 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": 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 [ - 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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/optional-chain.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 135, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 135, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 134, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 52, - 55, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 70, - 73, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 88, - 91, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 111, - 114, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "one": Object { - "$ref": 2, - }, - }, - "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": "one", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 134, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - ], - "name": "one", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$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, - "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, - "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, - "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 [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "one", - "range": Array [ - 29, - 38, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 193, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 29, - 38, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "processOptionalCall": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "processOptionalCall", - "range": Array [ - 9, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 193, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "processOptionalCall", - "range": Array [ - 9, - 28, - ], - "type": "Identifier", - }, - ], - "name": "processOptionalCall", - "references": Array [], - "scope": Object { - "$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-non-null-assertion.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 156, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 156, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 155, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 55, - 58, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 77, - 80, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 94, - 97, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 117, - 120, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 134, - 137, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "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 { - "$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 [ - 25, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 155, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 25, - 34, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "processOptional": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "processOptional", - "range": Array [ - 9, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 155, - ], - "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": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "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": 12, - "block": Object { - "range": Array [ - 0, - 217, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 51, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 66, - 69, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 85, - 88, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 104, - 107, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 129, - 132, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 156, - 159, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 169, - 172, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 184, - 187, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 202, - 205, - ], - "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 [], - "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", - }, - ], - "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, - }, - }, - ], - }, - ], - "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": 0, - "defs": Array [ - Object { - "name": Object { - "name": "processOptionalCallParens", - "range": Array [ - 9, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 217, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "processOptionalCallParens", - "range": Array [ - 9, - 34, - ], - "type": "Identifier", - }, - ], - "name": "processOptionalCallParens", - "references": Array [], - "scope": Object { - "$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-element-access.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 142, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 142, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 141, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 59, - 62, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 74, - 77, - ], - "type": "Identifier", - }, - "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, - }, - ], - "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 { - "$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", - }, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "processOptionalElement": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "processOptionalElement", - "range": Array [ - 9, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 141, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "processOptionalElement", - "range": Array [ - 9, - 31, - ], - "type": "Identifier", - }, - ], - "name": "processOptionalElement", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/optional-chain-element-access-with-non-null-assertion.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 183, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 183, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 182, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 64, - 67, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 89, - 92, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 113, - 116, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 136, - 139, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 160, - 163, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "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 { - "$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 [ - 25, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 182, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 25, - 34, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "processOptional": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "processOptional", - "range": Array [ - 9, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 182, - ], - "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": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/optional-chain-element-access-with-parens.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 168, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 168, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 167, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 54, - 57, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 68, - 71, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 85, - 88, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 122, - 125, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$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": 10, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "one": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$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 [ - 38, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 167, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 38, - 47, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "processOptionalElementParens": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "processOptionalElementParens", - "range": Array [ - 9, - 37, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 167, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "processOptionalElementParens", - "range": Array [ - 9, - 37, - ], - "type": "Identifier", - }, - ], - "name": "processOptionalElementParens", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/optional-chain-with-non-null-assertion.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 101, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 101, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 100, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 60, - 63, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "one": 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": "one", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - ], - "name": "one", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "processOptional": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "processOptional", - "range": Array [ - 9, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 100, - ], - "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": 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/optional-chain-with-parens.src 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 182, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 182, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 181, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 101, - 104, - ], - "type": "Identifier", - }, - "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": 10, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "one": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$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 [ - 31, - 40, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 181, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 31, - 40, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "processOptionalParens": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "processOptionalParens", - "range": Array [ - 9, - 30, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 181, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "processOptionalParens", - "range": Array [ - 9, - 30, - ], - "type": "Identifier", - }, - ], - "name": "processOptionalParens", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -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, - 211, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 211, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 106, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "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, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "arr", - "range": Array [ - 75, - 78, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "arr": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$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 [ - Object { - "name": "arr", - "range": Array [ - 13, - 39, - ], - "type": "Identifier", - }, - ], - "name": "arr", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - Object { - "$id": 10, - "block": Object { - "range": Array [ - 108, - 210, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "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 { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - "arr": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "arr", - "range": Array [ - 121, - 143, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 108, - 210, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "arr", - "range": Array [ - 121, - 143, - ], - "type": "Identifier", - }, - ], - "name": "arr", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - ], - "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 [ - 9, - 12, - ], - "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, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - Object { - "name": "foo", - "range": Array [ - 117, - 120, - ], - "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/readonly-tuples.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 119, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 119, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 118, - ], - "type": "FunctionDeclaration", - }, - "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, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "pair": 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": "pair", - "range": Array [ - 13, - 44, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 118, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "pair", - "range": Array [ - 13, - 44, - ], - "type": "Identifier", - }, - ], - "name": "pair", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$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 { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 118, - ], - "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": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/short-circuiting-assignment-and-and.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": null, - "writeExpr": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "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/short-circuiting-assignment-or-or.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": null, - "writeExpr": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "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/short-circuiting-assignment-question-question.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "rw", - "resolved": null, - "writeExpr": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "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/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": 4, - }, - "variableMap": Object { - "abc": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "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": "abc", - "range": Array [ - 14, - 38, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 42, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "abc", - "range": Array [ - 14, - 38, - ], - "type": "Identifier", - }, - ], - "name": "abc", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 9, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 42, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 9, - 13, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "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/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-export.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/type-alias-declaration-export-function-type.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", - }, - "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-export-object-type.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": 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/type-assertion-in-arrow-function.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 59, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 59, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 21, - 58, - ], - "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, - 58, - ], - "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 [ - 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, - 58, - ], - "type": "ArrowFunctionExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "assertString": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "assertString", - "range": Array [ - 6, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 58, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 58, - ], - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-assertion-in-function.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 56, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "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 [ - 23, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 23, - 29, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "assertsString": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "assertsString", - "range": Array [ - 9, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "assertsString", - "range": Array [ - 9, - 22, - ], - "type": "Identifier", - }, - ], - "name": "assertsString", - "references": Array [], - "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/type-assertion-in-interface.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 61, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 61, - ], - "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-in-method.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 111, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 111, - ], - "type": "Program", - }, - "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": 7, - }, - "variableMap": Object { - "AssertsFoo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-assertion-with-guard-in-arrow-function.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 69, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 69, - ], - "type": "Program", - }, - "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 [ - 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": 5, - }, - "variableMap": Object { - "assertString": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-assertion-with-guard-in-function.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "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": 5, - }, - "variableMap": Object { - "assertsStringGuard": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "assertsStringGuard", - "range": Array [ - 9, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "assertsStringGuard", - "range": Array [ - 9, - 27, - ], - "type": "Identifier", - }, - ], - "name": "assertsStringGuard", - "references": Array [], - "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/type-assertion-with-guard-in-interface.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 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": 5, - "block": Object { - "range": Array [ - 0, - 130, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 26, - 70, - ], - "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 [ - 81, - 128, - ], - "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, - 130, - ], - "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": 7, - }, - "variableMap": Object { - "AssertsFoo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "AssertsFoo", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 130, - ], - "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-guard-in-arrow-function.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 79, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 79, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 17, - 78, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 62, - 63, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "x": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 78, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "isString", - "range": Array [ - 6, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 17, - 78, - ], - "type": "ArrowFunctionExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "isString": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "isString", - "range": Array [ - 6, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 78, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 78, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "isString", - "range": Array [ - 6, - 14, - ], - "type": "Identifier", - }, - ], - "name": "isString", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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/type-guard-in-function.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 75, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 75, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 75, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": 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": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 75, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "isString": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "isString", - "range": Array [ - 9, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 75, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "isString", - "range": Array [ - 9, - 17, - ], - "type": "Identifier", - }, - ], - "name": "isString", - "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/type-guard-in-interface.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 57, - ], - "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-guard-in-method.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 148, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 148, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 19, - 75, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 67, - 70, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "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": 6, - "block": Object { - "range": Array [ - 86, - 145, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 137, - 140, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "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, - 147, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "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, - 147, - ], - "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/type-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/type-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/type-parameters-comments.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 138, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 138, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 44, - 87, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - Object { - "$id": 6, - "block": Object { - "range": Array [ - 88, - 137, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "bar": Object { - "$ref": 0, - }, - "baz": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 87, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 97, - 100, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 88, - 137, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 97, - 100, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 339, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 339, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 74, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "foo": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 74, - ], - "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, - }, - }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 75, - 164, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "foo2": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 164, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", - }, - ], - "name": "foo2", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 43, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 133, - 136, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - "foo2": Object { - "$ref": 1, - }, - }, - "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, - 74, - ], - "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, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 164, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", - }, - ], - "name": "foo2", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 77, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "AudioBufferList": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "AudioBufferList", - "range": Array [ - 6, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 77, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AudioBufferList", - "range": Array [ - 6, - 21, - ], - "type": "Identifier", - }, - ], - "name": "AudioBufferList", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "AudioBufferList": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "AudioBufferList", - "range": Array [ - 6, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 77, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AudioBufferList", - "range": Array [ - 6, - 21, - ], - "type": "Identifier", - }, - ], - "name": "AudioBufferList", - "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/typed-keyword-bigint.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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/typed-keyword-boolean.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 19, - ], - "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/typed-keyword-false.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 17, - ], - "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/typed-keyword-never.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 17, - ], - "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/typed-keyword-null.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 16, - ], - "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/typed-keyword-number.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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/typed-keyword-object.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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/typed-keyword-string.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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/typed-keyword-symbol.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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/typed-keyword-true.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 16, - ], - "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/typed-keyword-undefined.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 21, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 21, - ], - "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/typed-keyword-unknown.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 19, - ], - "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/typed-keyword-void.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 16, - ], - "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/typed-method-signature.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 58, - ], - "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/typed-this.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 90, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 90, - ], - "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/unique-symbol.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 24, - ], - "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/unknown-type-annotation.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 17, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 16, - ], - "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/var-with-definite-assignment.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 [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 17, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 22, - 32, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 32, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 18, - 33, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 22, - 32, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "z", - "range": Array [ - 38, - 48, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 38, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 34, - 49, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "z", - "range": Array [ - 38, - 48, - ], - "type": "Identifier", - }, - ], - "name": "z", - "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/var-with-dotted-type.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 4, - 14, - ], - "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/var-with-type.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 4, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 28, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 34, - 45, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 48, - 53, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 1, - }, - "name": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "name", - "range": Array [ - 4, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 4, - 15, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 34, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 53, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 30, - 54, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 34, - 45, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "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/variable-declaration-type-annotation-spacing.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 21, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/declare/abstract-class.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 31, - ], - "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 [ - 23, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 31, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 23, - 26, - ], - "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 [ - 23, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 31, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 23, - 26, - ], - "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/declare/class.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "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, - 22, - ], - "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, - 22, - ], - "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/declare/enum.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Bar": Object { - "$ref": 1, - }, - "Baz": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Bar", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 23, - 26, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Bar", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", - }, - ], - "name": "Bar", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Baz", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 35, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Baz", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - ], - "name": "Baz", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "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/declare/function.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "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": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/declare/interface.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "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/declare/module.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 19, - 23, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "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 { - "name": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "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/declare/namespace.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 22, - 26, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "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 { - "name": Object { - "name": "Foo", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 26, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "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/declare/type-alias.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 26, - ], - "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/declare/variable.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 12, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 21, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 12, - 20, - ], - "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/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 48, - 70, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "configurable", - "range": Array [ - 19, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Point": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Point", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 72, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Point", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - ], - "name": "Point", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Point": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Point", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 72, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Point", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - ], - "name": "Point", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-static-member.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 56, - 80, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Other": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Other", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Other", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - ], - "name": "Other", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Other": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Other", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Other", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - ], - "name": "Other", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 31, - 53, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "hidden", - "range": Array [ - 15, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "P": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "P", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 55, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "P", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "P", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "P": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "P", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 55, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "P", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "P", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 78, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 44, - 76, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 4, - }, - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 76, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "adminonly", - "range": Array [ - 18, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "User": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "User", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 78, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "User", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - ], - "name": "User", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "User": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "User", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 78, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "User", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - ], - "name": "User", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/class-decorators/class-decorator.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 [ - 0, - 20, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Qux": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Qux", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 20, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Qux", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Qux", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "sealed", - "range": Array [ - 1, - 7, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Qux": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Qux", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 20, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Qux", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Qux", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/class-decorators/class-decorator-factory.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "FooComponent": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "FooComponent", - "range": Array [ - 43, - 55, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 58, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "FooComponent", - "range": Array [ - 43, - 55, - ], - "type": "Identifier", - }, - ], - "name": "FooComponent", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Component", - "range": Array [ - 1, - 10, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "FooComponent": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "FooComponent", - "range": Array [ - 43, - 55, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 58, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "FooComponent", - "range": Array [ - 43, - 55, - ], - "type": "Identifier", - }, - ], - "name": "FooComponent", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 56, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 49, - 54, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "onlyRead", - "range": Array [ - 15, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "B": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "B": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 56, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 49, - 54, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/method-decorators/method-decorator-instance-member.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 42, - 47, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "onlyRead", - "range": Array [ - 15, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/method-decorators/method-decorator-static-member.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 42, - 47, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "D": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "D", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "D", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "D", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "D": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "D", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "D", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "D", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/parameter-decorators/parameter-array-pattern-decorator.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 49, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 49, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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 [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "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": 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/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 116, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 116, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 31, - 113, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "Inject", - "range": Array [ - 33, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "APP_CONFIG", - "range": Array [ - 40, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "config", - "range": Array [ - 94, - 100, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "config", - "range": Array [ - 52, - 69, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 31, - 113, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "config", - "range": Array [ - 52, - 69, - ], - "type": "Identifier", - }, - ], - "name": "config", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "Service": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Service", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 115, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Service", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - ], - "name": "Service", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "Service": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Service", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 115, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Service", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - ], - "name": "Service", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 19, - 50, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 21, - 28, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "baz": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 35, - 46, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 50, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 35, - 46, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 52, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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 [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 52, - ], - "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": 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/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 66, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 66, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 32, - 63, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 34, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "baz": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 63, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "StaticFoo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "StaticFoo", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 65, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "StaticFoo", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "StaticFoo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "StaticFoo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "StaticFoo", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 65, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "StaticFoo", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "StaticFoo", - "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/decorators/parameter-decorators/parameter-decorator-instance-member.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 98, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 98, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 97, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 25, - 95, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "required", - "range": Array [ - 27, - 35, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 78, - 82, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "name": Object { - "$ref": 3, - }, - }, - "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": "name", - "range": Array [ - 36, - 48, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 95, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 36, - 48, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "Greeter": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Greeter", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 97, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Greeter", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - ], - "name": "Greeter", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "Greeter": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Greeter", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 97, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Greeter", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - ], - "name": "Greeter", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-static-member.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 111, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 111, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 110, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 38, - 108, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "required", - "range": Array [ - 40, - 48, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 91, - 95, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "name": Object { - "$ref": 3, - }, - }, - "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": "name", - "range": Array [ - 49, - 61, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 38, - 108, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 49, - 61, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "StaticGreeter": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "StaticGreeter", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 110, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "StaticGreeter", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - ], - "name": "StaticGreeter", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "StaticGreeter": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "StaticGreeter", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 110, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "StaticGreeter", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - ], - "name": "StaticGreeter", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/parameter-decorators/parameter-object-pattern-decorator.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 49, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 49, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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 [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "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": 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/decorators/parameter-decorators/parameter-rest-element-decorator.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 48, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 48, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 50, - ], - "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": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "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 [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 50, - ], - "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": 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/decorators/property-decorators/property-decorator-factory-instance-member.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 88, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 88, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 88, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Input", - "range": Array [ - 27, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Output", - "range": Array [ - 46, - 52, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "EventEmitter", - "range": Array [ - 71, - 83, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "SomeComponent": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "SomeComponent", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 88, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "SomeComponent", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - ], - "name": "SomeComponent", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "SomeComponent": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "SomeComponent", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 88, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "SomeComponent", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - ], - "name": "SomeComponent", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-static-member.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 93, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 93, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 93, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "configurable", - "range": Array [ - 15, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "configurable", - "range": Array [ - 54, - 66, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 93, - ], - "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": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "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 [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 93, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/property-decorators/property-decorator-instance-member.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": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "B": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 39, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "B": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 39, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/property-decorators/property-decorator-static-member.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "qux", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 53, - ], - "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": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 53, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/class-empty-extends.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "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, - 22, - ], - "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, - 22, - ], - "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/errorRecovery/class-empty-extends-implements.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, - 37, - ], - "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, - 37, - ], - "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, - 37, - ], - "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/errorRecovery/class-extends-empty-implements.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "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 [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "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": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "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": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/class-multiple-implements.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 36, - ], - "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, - 36, - ], - "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, - 36, - ], - "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/errorRecovery/decorator-on-enum-declaration.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "E": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "E", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 14, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "E", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - ], - "name": "E", - "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/errorRecovery/decorator-on-function.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 19, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "b": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 19, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "b", - "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/errorRecovery/decorator-on-interface-declaration.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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/decorator-on-variable.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 19, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "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/errorRecovery/empty-type-arguments.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "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 { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 16, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 6, - 16, - ], - "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/errorRecovery/empty-type-arguments-in-call-expression.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 9, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "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/errorRecovery/empty-type-arguments-in-new-expression.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 4, - 7, - ], - "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/errorRecovery/empty-type-parameters.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "f1": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f1", - "range": Array [ - 9, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 18, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f1", - "range": Array [ - 9, - 11, - ], - "type": "Identifier", - }, - ], - "name": "f1", - "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/errorRecovery/empty-type-parameters-in-arrow-function.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "f1": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f1", - "range": Array [ - 9, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 18, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f1", - "range": Array [ - 9, - 11, - ], - "type": "Identifier", - }, - ], - "name": "f1", - "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/errorRecovery/empty-type-parameters-in-constructor.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 25, - 32, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "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": 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 [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-function-expression.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 12, - 27, - ], - "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 [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 27, - ], - "type": "FunctionExpression", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 27, - ], - "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": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 18, - 25, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "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": 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 [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "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": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 30, - ], - "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/errorRecovery/enum-with-keywords.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 72, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 7, - 72, - ], - "type": "TSEnumDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "X": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 72, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - ], - "name": "X", - "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/errorRecovery/index-signature-parameters.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 49, - ], - "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/errorRecovery/interface-empty-extends.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "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/errorRecovery/interface-implements.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": 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/errorRecovery/interface-index-signature-export.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": 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/errorRecovery/interface-index-signature-private.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 52, - ], - "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/errorRecovery/interface-index-signature-protected.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 54, - ], - "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/errorRecovery/interface-index-signature-public.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": 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/errorRecovery/interface-index-signature-static.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": 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/errorRecovery/interface-method-export.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 52, - ], - "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/errorRecovery/interface-method-private.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 53, - ], - "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/errorRecovery/interface-method-protected.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 53, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 53, - ], - "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/errorRecovery/interface-method-public.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 52, - ], - "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/errorRecovery/interface-method-readonly.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": 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/errorRecovery/interface-method-static.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/errorRecovery/interface-multiple-extends.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 41, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 41, - ], - "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/errorRecovery/interface-property-export.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 39, - ], - "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/errorRecovery/interface-property-private.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/errorRecovery/interface-property-protected.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 42, - ], - "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/errorRecovery/interface-property-public.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 41, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 41, - ], - "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/errorRecovery/interface-property-static.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 39, - ], - "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/errorRecovery/interface-property-with-default-value.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 39, - ], - "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/errorRecovery/interface-with-no-body.src 1`] = `"'{' expected."`; - -exports[`typescript fixtures/errorRecovery/interface-with-optional-index-signature.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 44, - ], - "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/errorRecovery/object-assertion-not-allowed.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 8, - 10, - ], - "type": "ObjectExpression", - }, - }, - ], - "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/errorRecovery/object-optional-not-allowed.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 12, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 8, - 10, - ], - "type": "ObjectExpression", - }, - }, - ], - "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/errorRecovery/solo-const.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 5, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 5, - ], - "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/expressions/call-expression-type-arguments.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "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/expressions/new-expression-type-arguments.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": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 20, - ], - "type": "NewExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "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 [ - 6, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 21, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - 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/expressions/optional-call-expression-type-arguments.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "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/expressions/tagged-template-expression-type-arguments.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 [ - 0, - 3, - ], - "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/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 30, - 56, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "fs": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "fs", - "range": Array [ - 41, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 41, - 43, - ], - "type": "ImportDefaultSpecifier", - }, - "parent": Object { - "range": Array [ - 34, - 54, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "fs", - "range": Array [ - 41, - 43, - ], - "type": "Identifier", - }, - ], - "name": "fs", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 84, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 84, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 21, - 84, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 32, - 82, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "selector": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "selector", - "range": Array [ - 48, - 64, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 82, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "selector", - "range": Array [ - 48, - 64, - ], - "type": "Identifier", - }, - ], - "name": "selector", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "select": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "select", - "range": Array [ - 41, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 82, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "select", - "range": Array [ - 41, - 47, - ], - "type": "Identifier", - }, - ], - "name": "select", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "d3": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "d3", - "range": Array [ - 18, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 84, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "d3", - "range": Array [ - 18, - 20, - ], - "type": "Identifier", - }, - ], - "name": "d3", - "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/namespaces-and-modules/global-module-declaration.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 92, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 92, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], - }, - Object { - "$id": 2, - "block": Object { - "range": Array [ - 43, - 51, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 81, - 89, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "global": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 51, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - Object { - "name": Object { - "name": "global", - "range": Array [ - 74, - 80, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 56, - 89, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", - }, - Object { - "name": "global", - "range": Array [ - 74, - 80, - ], - "type": "Identifier", - }, - ], - "name": "global", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 114, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 114, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 13, - 112, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 34, - 73, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 58, - 66, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 73, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 93, - 110, - ], - "type": "FunctionDeclaration", - }, - "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": "block", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - "bar": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 73, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 93, - 110, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` -Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 231, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 13, - "block": Object { - "range": Array [ - 0, - 231, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 12, - "block": Object { - "range": Array [ - 9, - 231, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 56, - 135, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 89, - 129, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - "x": Object { - "$ref": 7, - }, - "y": Object { - "$ref": 8, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 97, - 106, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 89, - 129, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 97, - 106, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 115, - 124, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 89, - 129, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 115, - 124, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Point": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "Point", - "range": Array [ - 62, - 67, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 56, - 135, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Point", - "range": Array [ - 62, - 67, - ], - "type": "Identifier", - }, - ], - "name": "Point", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - Object { - "$id": 11, - "block": Object { - "range": Array [ - 156, - 229, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 27, - 28, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 31, - 44, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "B": Object { - "$ref": 3, - }, - "Point": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Point", - "range": Array [ - 62, - 67, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 56, - 135, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Point", - "range": Array [ - 62, - 67, - ], - "type": "Identifier", - }, - ], - "name": "Point", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 154, - 155, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 147, - 229, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 154, - 155, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - "x": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 231, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 27, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 44, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 23, - 44, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 27, - 28, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$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/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 33, - ], - "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/types/array-type.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "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/types/conditional.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/conditional-infer.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 49, - ], - "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/types/conditional-infer-nested.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 127, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 127, - ], - "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/types/conditional-infer-simple.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 64, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 64, - ], - "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/types/conditional-with-null.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 46, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/constructor.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 44, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 4, - 42, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 42, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 43, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 4, - 42, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/types/constructor-generic.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 4, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 4, - 25, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/types/constructor-in-generic.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", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 30, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 30, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/constructor-with-rest.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 4, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 4, - 35, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/types/function.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 4, - 38, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 38, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 39, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 4, - 38, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/types/function-generic.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 [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 4, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 4, - 21, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/types/function-in-generic.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 25, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 24, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/function-with-array-destruction.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "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/types/function-with-object-destruction.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "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/types/function-with-rest.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/types/function-with-this.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 4, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 29, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 30, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 4, - 29, - ], - "type": "Identifier", - }, - ], - "name": "f", - "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/types/index-signature.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 38, - ], - "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/types/index-signature-readonly.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 49, - ], - "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/types/index-signature-without-type.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 30, - ], - "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/types/indexed.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "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": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/intersection-type.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/types/literal-number.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 8, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 9, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/literal-number-negative.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/literal-string.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 [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 12, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 13, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 12, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/mapped.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 36, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 35, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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/types/mapped-readonly.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 46, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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/types/mapped-readonly-minus.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 46, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 46, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 47, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 46, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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/types/mapped-readonly-plus.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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/types/mapped-untypped.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 { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", - }, - ], - "name": "map", - "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/types/nested-types.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 81, - ], - "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/types/parenthesized-type.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "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/types/reference.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 8, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 9, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/reference-generic.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 21, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 20, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/reference-generic-nested.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 { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/this-type.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 56, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 23, - 54, - ], - "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": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Message": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Message", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Message", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - ], - "name": "Message", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "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", - "range": Array [ - 6, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Message", - "range": Array [ - 6, - 13, - ], - "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/types/this-type-expanded.src 1`] = ` -Object { - "$id": 24, - "block": Object { - "range": Array [ - 0, - 452, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 23, - "block": Object { - "range": Array [ - 0, - 452, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 22, - "block": Object { - "range": Array [ - 0, - 451, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 46, - 91, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 22, - }, - "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 [ - 109, - 149, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 22, - }, - "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": 11, - "block": Object { - "range": Array [ - 167, - 237, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 203, - 215, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 8, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "fn", - "range": Array [ - 198, - 200, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 7, - }, - "writeExpr": Object { - "range": Array [ - 203, - 215, - ], - "type": "ArrowFunctionExpression", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "fn", - "range": Array [ - 228, - 230, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 7, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 22, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - "fn": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "fn", - "range": Array [ - 198, - 200, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 198, - 215, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 194, - 216, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "fn", - "range": Array [ - 198, - 200, - ], - "type": "Identifier", - }, - ], - "name": "fn", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - Object { - "$id": 17, - "block": Object { - "range": Array [ - 255, - 322, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [ - Object { - "$id": 16, - "block": Object { - "range": Array [ - 288, - 300, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 16, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 14, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "fn", - "range": Array [ - 283, - 285, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 13, - }, - "writeExpr": Object { - "range": Array [ - 288, - 300, - ], - "type": "ArrowFunctionExpression", - }, - }, - Object { - "$id": 15, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "fn", - "range": Array [ - 313, - 315, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 13, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 22, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 12, - }, - "fn": Object { - "$ref": 13, - }, - }, - "variableScope": Object { - "$ref": 17, - }, - "variables": Array [ - Object { - "$id": 12, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 17, - }, - }, - Object { - "$id": 13, - "defs": Array [ - Object { - "name": Object { - "name": "fn", - "range": Array [ - 283, - 285, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 283, - 300, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 279, - 301, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "fn", - "range": Array [ - 283, - 285, - ], - "type": "Identifier", - }, - ], - "name": "fn", - "references": Array [ - Object { - "$ref": 14, - }, - Object { - "$ref": 15, - }, - ], - "scope": Object { - "$ref": 17, - }, - }, - ], - }, - Object { - "$id": 19, - "block": Object { - "range": Array [ - 345, - 387, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 22, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 18, - }, - }, - "variableScope": Object { - "$ref": 19, - }, - "variables": Array [ - Object { - "$id": 18, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - ], - }, - Object { - "$id": 21, - "block": Object { - "range": Array [ - 404, - 449, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 22, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 20, - }, - }, - "variableScope": Object { - "$ref": 21, - }, - "variables": Array [ - Object { - "$id": 20, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 21, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 23, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 23, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 451, - ], - "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": 22, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 24, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 23, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 451, - ], - "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": 23, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 24, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/tuple.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/tuple-empty.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 11, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/tuple-named.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 42, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 40, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 40, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 41, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 40, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/tuple-named-optional.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 53, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 53, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 53, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/tuple-named-rest.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 34, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/tuple-named-type.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/types/tuple-optional.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "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": "x", - "range": Array [ - 4, - 44, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/tuple-rest.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 { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 28, - ], - "type": "Identifier", - }, - ], - "name": "x", - "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/types/tuple-type.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "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/types/type-literal.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 23, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 22, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "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/types/type-operator.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 38, - ], - "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 [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 36, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 37, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "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/types/typeof.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 17, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/union-intersection.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "intersection": Object { - "$ref": 1, - }, - "precedence1": Object { - "$ref": 2, - }, - "precedence2": Object { - "$ref": 3, - }, - "union": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "union", - "range": Array [ - 4, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 36, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 37, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "union", - "range": Array [ - 4, - 36, - ], - "type": "Identifier", - }, - ], - "name": "union", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "intersection", - "range": Array [ - 42, - 71, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 71, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 38, - 72, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "intersection", - "range": Array [ - 42, - 71, - ], - "type": "Identifier", - }, - ], - "name": "intersection", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "precedence1", - "range": Array [ - 77, - 115, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 77, - 115, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 73, - 116, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "precedence1", - "range": Array [ - 77, - 115, - ], - "type": "Identifier", - }, - ], - "name": "precedence1", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "precedence2", - "range": Array [ - 121, - 159, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 121, - 159, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 117, - 160, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "precedence2", - "range": Array [ - 121, - 159, - ], - "type": "Identifier", - }, - ], - "name": "precedence2", - "references": Array [], - "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/types/union-type.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "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 [], -} -`; diff --git a/packages/parser/tests/lib/basics.ts b/packages/parser/tests/lib/basics.ts deleted file mode 100644 index 0c90af58905..00000000000 --- a/packages/parser/tests/lib/basics.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { TSESLint } from '@typescript-eslint/experimental-utils'; -import { AST_NODE_TYPES } from '@typescript-eslint/types'; -import fs from 'fs'; -import glob from 'glob'; -import * as parser from '../../src/parser'; -import { - createScopeSnapshotTestBlock, - formatSnapshotName, -} from '../tools/test-utils'; - -const FIXTURES_DIR = './tests/fixtures/basics'; -const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.js`); - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -describe('basics', () => { - testFiles.forEach(filename => { - const code = fs.readFileSync(filename, 'utf8'); - it( - formatSnapshotName(filename, FIXTURES_DIR), - createScopeSnapshotTestBlock(code), - ); - }); - - it('https://github.com/eslint/typescript-eslint-parser/issues/476', () => { - const linter = new TSESLint.Linter(); - const code = ` -export const Price: React.SFC = function Price(props) {} -`; - const config: TSESLint.Linter.Config = { - parser: '@typescript-eslint/parser', - rules: { - test: 'error', - }, - }; - - linter.defineParser('@typescript-eslint/parser', parser); - linter.defineRule('test', function create(context) { - return { - TSTypeReference(node): void { - const name = context.getSourceCode().getText(node.typeName); - context.report({ - node, - message: 'called on {{name}}', - data: { name }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } as any); - }, - }; - }); - - const messages = linter.verify(code, config, { filename: 'issue.ts' }); - - expect(messages).toStrictEqual([ - { - column: 21, - endColumn: 42, - endLine: 2, - line: 2, - message: 'called on React.SFC', - nodeType: AST_NODE_TYPES.TSTypeReference, - ruleId: 'test', - severity: 2, - }, - { - column: 31, - endColumn: 41, - endLine: 2, - line: 2, - message: 'called on PriceProps', - nodeType: AST_NODE_TYPES.TSTypeReference, - ruleId: 'test', - severity: 2, - }, - ]); - }); -}); diff --git a/packages/parser/tests/lib/comments.ts b/packages/parser/tests/lib/comments.ts deleted file mode 100644 index 6f7c1d01a5c..00000000000 --- a/packages/parser/tests/lib/comments.ts +++ /dev/null @@ -1,31 +0,0 @@ -import fs from 'fs'; -import glob from 'glob'; -import { - createSnapshotTestBlock, - formatSnapshotName, -} from '../tools/test-utils'; -import { ParserOptions } from '../../src/parser-options'; - -const FIXTURES_DIR = - '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/comments'; -const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.js`); - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -describe('Comments', () => { - testFiles.forEach(filename => { - const code = fs.readFileSync(filename, 'utf8'); - const config: ParserOptions = { - sourceType: 'module', - ecmaFeatures: { - jsx: true, - }, - }; - it( - formatSnapshotName(filename, FIXTURES_DIR), - createSnapshotTestBlock(code, config), - ); - }); -}); diff --git a/packages/parser/tests/lib/javascript.ts b/packages/parser/tests/lib/javascript.ts deleted file mode 100644 index 32aa68bef34..00000000000 --- a/packages/parser/tests/lib/javascript.ts +++ /dev/null @@ -1,24 +0,0 @@ -import fs from 'fs'; -import glob from 'glob'; -import { - createScopeSnapshotTestBlock, - formatSnapshotName, -} from '../tools/test-utils'; - -const FIXTURES_DIR = - '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/javascript'; -const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.js`); - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -describe('javascript', () => { - testFiles.forEach(filename => { - const code = fs.readFileSync(filename, 'utf8'); - it( - formatSnapshotName(filename, FIXTURES_DIR), - createScopeSnapshotTestBlock(code), - ); - }); -}); diff --git a/packages/parser/tests/lib/jsx.ts b/packages/parser/tests/lib/jsx.ts deleted file mode 100644 index 7055ca98d19..00000000000 --- a/packages/parser/tests/lib/jsx.ts +++ /dev/null @@ -1,51 +0,0 @@ -import filesWithKnownIssues from '@typescript-eslint/shared-fixtures/dist/jsx-known-issues'; -import fs from 'fs'; -import glob from 'glob'; -import { - createScopeSnapshotTestBlock, - formatSnapshotName, -} from '../tools/test-utils'; - -const JSX_FIXTURES_DIR = - '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/jsx'; -const jsxTestFiles = glob - .sync(`${JSX_FIXTURES_DIR}/**/*.src.js`) - .filter(filename => - filesWithKnownIssues.every(fileName => !filename.includes(fileName)), - ); - -const JSX_JSXTEXT_FIXTURES_DIR = - '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/jsx-useJSXTextNode'; -const jsxTextTestFiles = glob.sync(`${JSX_JSXTEXT_FIXTURES_DIR}/**/*.src.js`); - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -describe('JSX', () => { - /** - * Test each fixture file - */ - function testFixture(fixturesDir: string, useJSXTextNode: boolean) { - return (filename: string): void => { - const code = fs.readFileSync(filename, 'utf8'); - const config = { - useJSXTextNode, - ecmaFeatures: { - jsx: true, - }, - }; - it( - formatSnapshotName(filename, fixturesDir), - createScopeSnapshotTestBlock(code, config), - ); - }; - } - - describe('useJSXTextNode: false', () => { - jsxTestFiles.forEach(testFixture(JSX_FIXTURES_DIR, false)); - }); - describe('useJSXTextNode: true', () => { - jsxTextTestFiles.forEach(testFixture(JSX_JSXTEXT_FIXTURES_DIR, true)); - }); -}); diff --git a/packages/parser/tests/lib/parser.ts b/packages/parser/tests/lib/parser.ts index f8050773c6c..ba4a1663c8e 100644 --- a/packages/parser/tests/lib/parser.ts +++ b/packages/parser/tests/lib/parser.ts @@ -1,9 +1,12 @@ import { TSESLint } from '@typescript-eslint/experimental-utils'; import * as typescriptESTree from '@typescript-eslint/typescript-estree/dist/parser'; import { parse, parseForESLint } from '../../src/parser'; -import * as scope from '../../src/analyze-scope'; describe('parser', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + it('parse() should return just the AST from parseForESLint()', () => { const code = 'const valid = true;'; expect(parse(code)).toEqual(parseForESLint(code).ast); @@ -14,25 +17,6 @@ describe('parser', () => { expect(() => parseForESLint(code, null)).not.toThrow(); }); - it('parseForESLint() should set the sourceType to script, if an invalid one is provided', () => { - const code = 'const valid = true;'; - const spy = jest.spyOn(typescriptESTree, 'parseAndGenerateServices'); - const spyScope = jest.spyOn(scope, 'analyzeScope'); - // intentionally wrong sourceType - // eslint-disable-next-line @typescript-eslint/no-explicit-any - parseForESLint(code, { sourceType: 'foo' as any }); - expect(spy).toHaveBeenCalledWith(code, { - ecmaFeatures: {}, - jsx: false, - sourceType: 'script', - useJSXTextNode: true, - }); - expect(spyScope).toHaveBeenCalledWith(expect.any(Object), { - ecmaFeatures: {}, - sourceType: 'script', - }); - }); - it('parseAndGenerateServices() should be called with options', () => { const code = 'const valid = true;'; const spy = jest.spyOn(typescriptESTree, 'parseAndGenerateServices'); @@ -57,7 +41,8 @@ describe('parser', () => { extraFileExtensions: ['.foo'], }; parseForESLint(code, config); - expect(spy).toHaveBeenCalledWith(code, { + expect(spy).toHaveBeenCalledTimes(1); + expect(spy).toHaveBeenLastCalledWith(code, { jsx: false, ...config, }); @@ -72,7 +57,9 @@ describe('parser', () => { jsx: false, sourceType: 'script', useJSXTextNode: true, + warnOnUnsupportedTypeScriptVersion: true, }); + spy.mockClear(); parseForESLint(code, { warnOnUnsupportedTypeScriptVersion: false }); expect(spy).toHaveBeenCalledWith(code, { ecmaFeatures: {}, diff --git a/packages/parser/tests/lib/scope-analysis.ts b/packages/parser/tests/lib/scope-analysis.ts deleted file mode 100644 index 525eebb2394..00000000000 --- a/packages/parser/tests/lib/scope-analysis.ts +++ /dev/null @@ -1,47 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { createScopeSnapshotTestBlock } from '../tools/test-utils'; - -describe('TypeScript scope analysis', () => { - const fixturesDir = 'tests/fixtures/scope-analysis'; - const files = fs - .readdirSync(fixturesDir) - .map(filename => path.join(fixturesDir, filename).replace(/\\/g, '/')); - - describe('sourceType: module', () => { - for (const filePath of files) { - const code = fs.readFileSync(filePath, 'utf8'); - it( - filePath, - createScopeSnapshotTestBlock(code, { - loc: true, - range: true, - tokens: true, - sourceType: 'module', - ecmaFeatures: { - jsx: path.extname(filePath) === '.tsx', - }, - }), - ); - } - }); - - describe('sourceType: script', () => { - for (const filePath of files) { - const code = fs.readFileSync(filePath, 'utf8'); - - it( - filePath, - createScopeSnapshotTestBlock(code, { - loc: true, - range: true, - tokens: true, - sourceType: 'script', - ecmaFeatures: { - jsx: path.extname(filePath) === '.tsx', - }, - }), - ); - } - }); -}); diff --git a/packages/parser/tests/lib/tsx.ts b/packages/parser/tests/lib/tsx.ts index 21937886b5d..0e057e00da4 100644 --- a/packages/parser/tests/lib/tsx.ts +++ b/packages/parser/tests/lib/tsx.ts @@ -1,35 +1,11 @@ import { TSESLint } from '@typescript-eslint/experimental-utils'; -import fs from 'fs'; -import glob from 'glob'; import * as parser from '../../src/parser'; -import { - createScopeSnapshotTestBlock, - formatSnapshotName, -} from '../tools/test-utils'; - -const FIXTURES_DIR = - '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/tsx'; -const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.tsx`); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ describe('TSX', () => { - testFiles.forEach(filename => { - const code = fs.readFileSync(filename, 'utf8'); - const config = { - useJSXTextNode: true, - ecmaFeatures: { - jsx: true, - }, - }; - it( - formatSnapshotName(filename, FIXTURES_DIR, '.tsx'), - createScopeSnapshotTestBlock(code, config), - ); - }); - describe("if the filename ends with '.tsx', enable jsx option automatically.", () => { const linter = new TSESLint.Linter(); linter.defineParser('@typescript-eslint/parser', parser); diff --git a/packages/parser/tests/lib/typescript.ts b/packages/parser/tests/lib/typescript.ts deleted file mode 100644 index 210699029cc..00000000000 --- a/packages/parser/tests/lib/typescript.ts +++ /dev/null @@ -1,24 +0,0 @@ -import fs from 'fs'; -import glob from 'glob'; -import { - createScopeSnapshotTestBlock, - formatSnapshotName, -} from '../tools/test-utils'; - -const FIXTURES_DIR = - '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/typescript'; -const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.ts`); - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -describe('typescript', () => { - testFiles.forEach(filename => { - const code = fs.readFileSync(filename, 'utf8'); - it( - formatSnapshotName(filename, FIXTURES_DIR, '.ts'), - createScopeSnapshotTestBlock(code), - ); - }); -}); diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts deleted file mode 100644 index 3def6a382de..00000000000 --- a/packages/parser/tests/tools/scope-analysis.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { - TSESTree, - TSESLintScope, - AST_NODE_TYPES, -} from '@typescript-eslint/experimental-utils'; -import { ScopeManager } from '../../src/scope/scope-manager'; - -/** Reference resolver. */ -export class ReferenceResolver { - map: Map; - - constructor() { - this.map = new Map(); - } - - resolve(obj: TKey, properties: T): T & { $id: number } { - const resolved = { ...properties, $id: this.map.size }; - this.map.set(obj, resolved); - return resolved; - } - - ref(obj: TKey): { $ref: number } | TKey { - if (typeof obj !== 'object' || obj === null) { - return obj; - } - - const map = this.map; - return { - get $ref(): number { - return map.get(obj)!.$id; - }, - }; - } -} - -/** - * Convert a given node object to JSON object. - * This saves only type and range to know what the node is. - * @param node The AST node object. - * @returns The object that can be used for JSON.stringify. - */ -export function nodeToJSON( - node: TSESTree.Node | null | undefined, -): - | { type: AST_NODE_TYPES; range: [number, number]; name?: string } - | null - | undefined { - if (!node) { - return node; - } - - const { type, range } = node; - if (node.type === AST_NODE_TYPES.Identifier) { - return { type, name: node.name, range }; - } - return { type, range }; -} - -/** - * Convert a given variable object to JSON object. - * @param variable The eslint-scope's variable object. - * @param resolver The reference resolver. - * @returns The object that can be used for JSON.stringify. - */ -export function variableToJSON( - variable: TSESLintScope.Variable, - resolver: ReferenceResolver, -): unknown { - const { name, eslintUsed } = variable; - const defs = variable.defs.map(d => ({ - type: d.type, - name: nodeToJSON(d.name), - node: nodeToJSON(d.node), - parent: nodeToJSON(d.parent), - })); - const identifiers = variable.identifiers.map(nodeToJSON); - const references = variable.references.map(resolver.ref, resolver); - const scope = resolver.ref(variable.scope); - - return resolver.resolve(variable, { - name, - defs, - identifiers, - references, - scope, - eslintUsed, - }); -} - -/** - * Convert a given reference object to JSON object. - * @param reference The eslint-scope's reference object. - * @param resolver The reference resolver. - * @returns The object that can be used for JSON.stringify. - */ -export function referenceToJSON( - reference: TSESLintScope.Reference, - resolver: ReferenceResolver, -): unknown { - const kind = `${reference.isRead() ? 'r' : ''}${ - reference.isWrite() ? 'w' : '' - }`; - const from = resolver.ref(reference.from); - const identifier = nodeToJSON(reference.identifier); - const writeExpr = nodeToJSON(reference.writeExpr); - const resolved = resolver.ref(reference.resolved); - - return resolver.resolve(reference, { - kind, - from, - identifier, - writeExpr, - resolved, - }); -} - -/** - * Convert a given scope object to JSON object. - * @param scope The eslint-scope's scope object. - * @param resolver The reference resolver. - * @returns {Object} The object that can be used for JSON.stringify. - */ -export function scopeToJSON( - scope: TSESLintScope.Scope, - resolver = new ReferenceResolver(), -): unknown { - const { type, functionExpressionScope, isStrict } = scope; - const block = nodeToJSON(scope.block); - const variables = scope.variables.map(v => variableToJSON(v, resolver)); - const references = scope.references.map(r => referenceToJSON(r, resolver)); - const variableMap = Array.from(scope.set.entries()).reduce< - Record - >((map, [name, variable]) => { - map[name] = resolver.ref(variable); - return map; - }, {}); - const throughReferences = scope.through.map(resolver.ref, resolver); - const variableScope = resolver.ref(scope.variableScope); - const upperScope = resolver.ref(scope.upper); - const childScopes = scope.childScopes.map(c => scopeToJSON(c, resolver)); - - return resolver.resolve(scope, { - type, - functionExpressionScope, - isStrict, - block, - variables, - references, - variableMap, - throughReferences, - variableScope, - upperScope, - childScopes, - }); -} - -export function getScopeTree(scopeManager: ScopeManager): unknown { - const { globalScope } = scopeManager; - - // Do the postprocess to test. - // https://github.com/eslint/eslint/blob/84ce72fdeba082b7b132e4ac6b714fb1a93831b7/lib/linter.js#L112-L129 - globalScope.through = globalScope.through.filter(reference => { - const name = reference.identifier.name; - const variable = globalScope.set.get(name); - if (variable) { - reference.resolved = variable; - variable.references.push(reference); - return false; - } - return true; - }); - - return scopeToJSON(globalScope); -} diff --git a/packages/parser/tests/tools/test-utils.ts b/packages/parser/tests/tools/test-utils.ts index 28dd40d2e07..3b58e4d7536 100644 --- a/packages/parser/tests/tools/test-utils.ts +++ b/packages/parser/tests/tools/test-utils.ts @@ -1,7 +1,6 @@ import { TSESTree } from '@typescript-eslint/typescript-estree'; import * as parser from '../../src/parser'; import { ParserOptions } from '../../src/parser-options'; -import { getScopeTree } from './scope-analysis'; const defaultConfig = { loc: true, @@ -67,45 +66,6 @@ export function createSnapshotTestBlock( }; } -/** - * Returns a function which can be used as the callback of a Jest test() block, - * and which performs an assertion on the snapshot for the given code and config. - * @param code The source code to parse - * @param config the parser configuration - * @returns callback for Jest test() block - */ -export function createScopeSnapshotTestBlock( - code: string, - config: ParserOptions = {}, -): () => void { - config = Object.assign({}, defaultConfig, config); - - /** - * @returns {Object} the AST object - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - function parse(): any { - const result = parser.parseForESLint(code, config); - return getScopeTree(result.scopeManager); - } - - return (): void => { - try { - const result = parse(); - expect(result).toMatchSnapshot(); - } catch (e) { - /** - * If we are deliberately throwing because of encountering an unknown - * AST_NODE_TYPE, we rethrow to cause the test to fail - */ - if (e.message.match('Unknown AST_NODE_TYPE')) { - throw new Error(e); - } - expect(parse).toThrowErrorMatchingSnapshot(); - } - }; -} - /** * @param code The code being parsed * @param config The configuration object for the parser diff --git a/packages/parser/tsconfig.build.json b/packages/parser/tsconfig.build.json index 4de958191f1..065e6086743 100644 --- a/packages/parser/tsconfig.build.json +++ b/packages/parser/tsconfig.build.json @@ -9,8 +9,9 @@ "include": ["src"], "references": [ { "path": "../experimental-utils/tsconfig.build.json" }, - { "path": "../shared-fixtures/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" }, - { "path": "../typescript-estree/tsconfig.build.json" } + { "path": "../typescript-estree/tsconfig.build.json" }, + { "path": "../scope-manager/tsconfig.build.json" }, + { "path": "../shared-fixtures/tsconfig.build.json" } ] } diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts index 36df71a019a..89c2f832596 100644 --- a/packages/types/src/ts-estree.ts +++ b/packages/types/src/ts-estree.ts @@ -1454,7 +1454,7 @@ export interface TSLiteralType extends BaseNode { export interface TSMappedType extends BaseNode { type: AST_NODE_TYPES.TSMappedType; - typeParameter: TSTypeParameterDeclaration; + typeParameter: TSTypeParameter; readonly?: boolean | '-' | '+'; optional?: boolean | '-' | '+'; typeAnnotation?: TypeNode; @@ -1479,7 +1479,7 @@ export interface TSModuleBlock extends BaseNode { export interface TSModuleDeclaration extends BaseNode { type: AST_NODE_TYPES.TSModuleDeclaration; id: Identifier | Literal; - body?: TSModuleBlock | TSModuleDeclaration; + body?: TSModuleBlock; global?: boolean; declare?: boolean; modifiers?: Modifier[];