diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index b939f8214a92..502b3a3af3a5 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -22,41 +22,24 @@ export default util.createRule({ create(context) { const rules = baseRule.create(context); - /** - * Mark heritage clause as used - * @param node The node currently being traversed - */ - function markHeritageAsUsed(node: TSESTree.Expression): void { + function markParameterAsUsed(node: TSESTree.Node): void { switch (node.type) { case AST_NODE_TYPES.Identifier: context.markVariableAsUsed(node.name); break; - case AST_NODE_TYPES.MemberExpression: - markHeritageAsUsed(node.object); + case AST_NODE_TYPES.AssignmentPattern: + markParameterAsUsed(node.left); break; - case AST_NODE_TYPES.CallExpression: - markHeritageAsUsed(node.callee); + case AST_NODE_TYPES.RestElement: + markParameterAsUsed(node.argument); break; } } return Object.assign({}, rules, { - 'TSTypeReference Identifier'(node: TSESTree.Identifier) { - context.markVariableAsUsed(node.name); - }, - TSInterfaceHeritage(node: TSESTree.TSInterfaceHeritage) { - if (node.expression) { - markHeritageAsUsed(node.expression); - } - }, - TSClassImplements(node: TSESTree.TSClassImplements) { - if (node.expression) { - markHeritageAsUsed(node.expression); - } - }, - 'TSParameterProperty Identifier'(node: TSESTree.Identifier) { + TSParameterProperty(node: TSESTree.TSParameterProperty) { // just assume parameter properties are used - context.markVariableAsUsed(node.name); + markParameterAsUsed(node.parameter); }, 'TSEnumMember Identifier'(node: TSESTree.Identifier) { context.markVariableAsUsed(node.name); 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 2c66ec1ee5af..5144584c9594 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -100,6 +100,21 @@ function isOuterVariable( ); } +/** + * Checks whether or not a given variable is a type declaration. + */ +function isType( + variable: TSESLint.Scope.Variable, + reference: TSESLint.Scope.Reference, +): boolean { + const node = variable.defs[0].node as TSESTree.Node; + + return ( + node.type === AST_NODE_TYPES.TSTypeAliasDeclaration && + isOuterScope(variable, reference) + ); +} + /** * Checks whether or not a given location is inside of the range of a given node. */ @@ -231,6 +246,9 @@ export default util.createRule({ if (isOuterClass(variable, reference)) { return !!options.classes; } + if (isType(variable, reference)) { + return !!options.typedefs; + } if (isOuterVariable(variable, reference)) { return !!options.variables; } diff --git a/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts index 45ca71b4a79f..edd9a0b26609 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts @@ -83,6 +83,10 @@ interface B {} type C = Array class D {} `, + ` +interface foo {} +interface 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 38d58b482fd3..9607e2363458 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -3,10 +3,10 @@ import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parserOptions: { - ecmaVersion: 6, + ecmaVersion: 10, sourceType: 'module', - ecmaFeatures: {}, }, + env: { es6: true }, parser: '@typescript-eslint/parser', }); @@ -35,12 +35,16 @@ class X { } `, // https://github.com/eslint/typescript-eslint-parser/issues/466 - ` + { + code: ` /*globals document, selector */ const links = document.querySelectorAll( selector ) as NodeListOf - `, + `, + env: { browser: true }, + }, // https://github.com/eslint/typescript-eslint-parser/issues/437 ` +type Result = string interface Runnable { run (): Result toString (): string @@ -60,7 +64,7 @@ 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 { +function eachr(subject: Object | Array): typeof subject { return subject } `, @@ -85,6 +89,18 @@ function eachr(subject: Map): typeof subject; var a = { b: () => {} }; a?.b(); `, + // https://github.com/typescript-eslint/typescript-eslint/issues/262 + ` +export default class Foo { + [key: string]: any; +} + `, + // https://github.com/typescript-eslint/typescript-eslint/issues/262 + ` +export default interface Foo { + [key: string]: any; +} + `, ], invalid: [ { @@ -120,5 +136,26 @@ function eachr(subject: Map): typeof subject; }, ], }, + { + code: 'function foo(subject: Object | Array)', + errors: [ + { + messageId: 'undef', + data: { + name: 'Key', + }, + line: 1, + column: 30, + }, + { + messageId: 'undef', + data: { + name: 'Value', + }, + line: 1, + column: 43, + }, + ], + }, ], }); 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 45bb8c80db15..24a0fae1a568 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -127,23 +127,31 @@ const a: Base = {} console.log(a); `, ` -import { Foo } from 'foo' -function bar() {} +import { Foo, baz } from 'foo' +function bar() { + baz() +} bar() `, ` -import { Foo } from 'foo' -const bar = function () {} +import { Foo, baz } from 'foo' +const bar = function () { + baz() +} bar() `, ` -import { Foo } from 'foo' -const bar = () => {} +import { Foo, baz } from 'foo' +const bar = () => { + baz() +} bar() `, ` import { Foo } from 'foo' -(() => {})() +(() => { + new baz() +})() `, ` import { Nullable } from 'nullable'; @@ -265,14 +273,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; } `, @@ -308,7 +316,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; } `, @@ -316,52 +324,64 @@ 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 { + test() { return new Array() } +} new Bar() - `, + `, ` import { Foo, Bar } from './types'; -class Baz {} +class Baz { + test() { return new Array() } +} new Baz() - `, + `, ` import { Foo } from './types'; -class Bar {} +class Bar { + test() { return new Array() } +} new Bar() - `, + `, ` import { Foo } from './types'; -class Foo {} +class Foo { + test() { return new Array() } +} new Foo() - `, + `, ` import { Foo } from './types'; -class Foo {} +class Foo { + test() { return new Array() } +} new Foo() - `, + `, ` import { Foo } from './types'; -class Foo {} +class Foo { + test() { return new Array() } +} new Foo() - `, + `, ` type Foo = "a" | "b" | "c" type Bar = number @@ -382,7 +402,7 @@ new A(); ` import { Nullable } from 'nullable'; import { SomeOther } from 'other'; -function foo() { +function foo(): T { } foo(); `, @@ -469,47 +489,51 @@ 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 { + test() { new test(); } +} + `, ` import webpack from 'webpack'; export default function webpackLoader(this: webpack.loader.LoaderContext) {} - `, + `, ` import execa, { Options as ExecaOptions } from 'execa'; export function foo(options: ExecaOptions): execa { options() } - `, + `, ` import { Foo, Bar } from './types'; -export class Baz {} - `, +export class Baz { + test() { new test(); } +} + `, ` // warning 'B' is defined but never used export const a: Array<{b: B}> = [] - `, + `, ` export enum FormFieldIds { PHONE = 'phone', EMAIL = 'email', } - `, + `, ` enum FormFieldIds { PHONE = 'phone', EMAIL = 'email', } -interface IFoo { +export interface IFoo { fieldName: FormFieldIds, } - `, + `, ` enum FormFieldIds { PHONE = 'phone', EMAIL = 'email', } -interface IFoo { +export interface IFoo { fieldName: FormFieldIds.EMAIL, } `, @@ -615,7 +639,7 @@ export default class Foo { code: ` import { ClassDecoratorFactory } from 'decorators'; export class Foo {} - `, + `, errors: error([ { message: "'ClassDecoratorFactory' is defined but never used.", @@ -629,13 +653,18 @@ export class Foo {} import { Foo, Bar } from 'foo'; function baz() {} baz() - `, + `, errors: error([ { message: "'Foo' is defined but never used.", line: 2, column: 10, }, + { + message: "'Foo' is defined but never used.", + line: 3, + column: 14, + }, ]), }, { @@ -643,7 +672,7 @@ baz() import { Nullable } from 'nullable'; const a: string = 'hello'; console.log(a); - `, + `, errors: error([ { message: "'Nullable' is defined but never used.", @@ -733,6 +762,11 @@ interface A { line: 3, column: 10, }, + { + message: "'A' is defined but never used.", + line: 4, + column: 11, + }, ]), }, { @@ -749,6 +783,11 @@ interface A { line: 3, column: 10, }, + { + message: "'A' is defined but never used.", + line: 4, + column: 11, + }, ]), }, { @@ -886,5 +925,131 @@ export class Bar implements baz().test {} }, ]), }, + { + code: ` +import { Foo } from 'foo' +function bar() {} +bar() + `, + errors: error([ + { + message: "'T' is defined but never used.", + line: 3, + column: 14, + }, + ]), + }, + { + code: ` +import { Foo } from 'foo' +const bar = function () {} +bar() + `, + errors: error([ + { + message: "'T' is defined but never used.", + line: 3, + column: 23, + }, + ]), + }, + { + code: ` +import { Foo } from 'foo' +(() => {})() + `, + errors: error([ + { + message: "'T' is defined but never used.", + line: 3, + column: 8, + }, + ]), + }, + { + code: ` +import { Nullable } from 'nullable'; +import { SomeOther } from 'other'; +function foo() { +} +foo(); + `, + errors: error([ + { + message: "'T' is defined but never used.", + line: 4, + column: 14, + }, + ]), + }, + { + code: ` +const foo = 2; +new test(); + `, + errors: error([ + { + message: "'foo' is assigned a value but never used.", + line: 2, + column: 7, + }, + ]), + }, + { + code: ` +type foo = 2; +const test = foo; +class bar {}; + `, + errors: error([ + { + message: "'foo' is defined but never used.", + line: 2, + column: 6, + }, + { + message: "'test' is assigned a value but never used.", + line: 3, + column: 7, + }, + { + message: "'bar' is defined but never used.", + line: 4, + column: 7, + }, + { + message: "'test' is defined but never used.", + line: 4, + column: 11, + }, + ]), + }, + { + code: ` +interface IFoo { + fieldName: FormFieldIds, +} + `, + errors: error([ + { + message: "'IFoo' is defined but never used.", + line: 2, + column: 11, + }, + ]), + }, + { + code: ` +import { Foo, Bar } from './types'; +export class Baz { } + `, + errors: error([ + { + message: "'F' is defined but never used.", + line: 3, + column: 18, + }, + ]), + }, ], }); 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 9d9434397fd4..b9a7dcae6d54 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 @@ -907,7 +907,22 @@ enum Foo { ], errors: [ { + line: 3, + column: 13, messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + }, + { + line: 3, + column: 19, + messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + }, + { + line: 4, + column: 12, + messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, }, ], }, @@ -928,7 +943,16 @@ enum Foo { ], errors: [ { + line: 2, + column: 17, messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + }, + { + line: 3, + column: 10, + messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, }, ], }, @@ -951,5 +975,20 @@ enum Foo { }, ], }, + // types + { + code: ` +var x: Foo = 2; +type Foo = string | number + `, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { + name: 'Foo', + }, + }, + ], + }, ], }); diff --git a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts b/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts index 6169d9def9a5..09e8792ac44c 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts @@ -9,13 +9,14 @@ import { import { Scope } from './Scope'; import { ScopeManager } from './ScopeManager'; -interface Referencer extends Visitor { +interface Referencer> + extends Visitor { isInnerMethodDefinition: boolean; options: any; scopeManager: SM; parent?: TSESTree.Node; - currentScope(): Scope; + currentScope(): SC; close(node: TSESTree.Node): void; pushInnerMethodDefinition(isInnerMethodDefinition: boolean): boolean; popInnerMethodDefinition(isInnerMethodDefinition: boolean): void; @@ -33,7 +34,12 @@ interface Referencer extends Visitor { ): void; visitFunction(node: TSESTree.Node): void; visitClass(node: TSESTree.Node): void; - visitProperty(node: TSESTree.Node): void; + visitProperty( + node: + | TSESTree.MethodDefinition + | TSESTree.TSAbstractMethodDefinition + | TSESTree.Property, + ): void; visitForIn(node: TSESTree.Node): void; visitVariableDeclaration( variableTargetScope: any, @@ -75,7 +81,10 @@ interface Referencer extends Visitor { MetaProperty(): void; } const Referencer = ESLintReferencer as { - new (options: any, scopeManager: SM): Referencer; + new >( + options: any, + scopeManager: SM, + ): Referencer; }; export { Referencer }; diff --git a/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/packages/experimental-utils/src/ts-eslint-scope/Scope.ts index 6c5481aa4d77..dd6aa31aa8d6 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/Scope.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/Scope.ts @@ -32,7 +32,9 @@ type ScopeType = | 'with' | 'TDZ' | 'enum' - | 'empty-function'; + | 'empty-function' + | 'interface' + | 'type-alias'; interface Scope { type: ScopeType; diff --git a/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts b/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts index 6d05fea395f9..490a56deec2e 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts @@ -13,14 +13,14 @@ interface ScopeManagerOptions { ecmaVersion?: number; } -interface ScopeManager { +interface ScopeManager { __options: ScopeManagerOptions; - __currentScope: Scope; - __nodeToScope: WeakMap; + __currentScope: SC; + __nodeToScope: WeakMap; __declaredVariables: WeakMap; - scopes: Scope[]; - globalScope: Scope; + scopes: SC[]; + globalScope: SC; __useDirective(): boolean; __isOptimistic(): boolean; @@ -31,30 +31,32 @@ interface ScopeManager { isStrictModeSupported(): boolean; // Returns appropriate scope for this node. - __get(node: TSESTree.Node): Scope | undefined; + __get(node: TSESTree.Node): SC[] | undefined; getDeclaredVariables(node: TSESTree.Node): Variable[]; - acquire(node: TSESTree.Node, inner?: boolean): Scope | null; - acquireAll(node: TSESTree.Node): Scope | null; - release(node: TSESTree.Node, inner?: boolean): Scope | null; + acquire(node: TSESTree.Node, inner?: boolean): SC | null; + acquireAll(node: TSESTree.Node): SC | null; + release(node: TSESTree.Node, inner?: boolean): SC | null; attach(): void; detach(): void; __nestScope(scope: T): T; - __nestGlobalScope(node: TSESTree.Node): Scope; - __nestBlockScope(node: TSESTree.Node): Scope; - __nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): Scope; - __nestForScope(node: TSESTree.Node): Scope; - __nestCatchScope(node: TSESTree.Node): Scope; - __nestWithScope(node: TSESTree.Node): Scope; - __nestClassScope(node: TSESTree.Node): Scope; - __nestSwitchScope(node: TSESTree.Node): Scope; - __nestModuleScope(node: TSESTree.Node): Scope; - __nestFunctionExpressionNameScope(node: TSESTree.Node): Scope; + __nestGlobalScope(node: TSESTree.Node): SC; + __nestBlockScope(node: TSESTree.Node): SC; + __nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): SC; + __nestForScope(node: TSESTree.Node): SC; + __nestCatchScope(node: TSESTree.Node): SC; + __nestWithScope(node: TSESTree.Node): SC; + __nestClassScope(node: TSESTree.Node): SC; + __nestSwitchScope(node: TSESTree.Node): SC; + __nestModuleScope(node: TSESTree.Node): SC; + __nestFunctionExpressionNameScope(node: TSESTree.Node): SC; __isES6(): boolean; } const ScopeManager = ESLintScopeManager as { - new (options: ScopeManagerOptions): ScopeManager; + new (options: ScopeManagerOptions): ScopeManager< + SC + >; }; export { ScopeManager, ScopeManagerOptions }; diff --git a/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/packages/experimental-utils/src/ts-eslint/RuleTester.ts index ce441603bf1c..cdf60d53c22b 100644 --- a/packages/experimental-utils/src/ts-eslint/RuleTester.ts +++ b/packages/experimental-utils/src/ts-eslint/RuleTester.ts @@ -6,6 +6,11 @@ import { RuleTester as ESLintRuleTester } from 'eslint'; import { ParserOptions } from './ParserOptions'; import { RuleModule } from './Rule'; +interface EnvTestOptions { + browser?: boolean; + es6?: boolean; +} + interface ValidTestCase> { code: string; options?: TOptions; @@ -14,9 +19,7 @@ interface ValidTestCase> { settings?: Record; parser?: string; globals?: Record; - env?: { - browser?: boolean; - }; + env?: EnvTestOptions; } interface SuggestionOutput { @@ -59,6 +62,7 @@ interface RunTests< interface RuleTesterConfig { // should be require.resolve(parserPackageName) parser: string; + env?: EnvTestOptions; parserOptions?: ParserOptions; } @@ -89,6 +93,7 @@ class RuleTester extends (ESLintRuleTester as { } export { + EnvTestOptions, InvalidTestCase, SuggestionOutput, RuleTester, diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 4e680373d774..d09f6d51510a 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -6,93 +6,14 @@ import { import { getKeys as fallback } from 'eslint-visitor-keys'; import { ParserOptions } from './parser-options'; +import { typeReferencing } from './scope/typeReferencing'; import { ScopeManager } from './scope/scope-manager'; import { visitorKeys as childVisitorKeys } from '@typescript-eslint/typescript-estree'; +import { TypeDefinition } from './scope/TypeDefinition'; +import { PatternVisitor } from './scope/pattern-visitor'; +import { Scope } from './scope/scopes'; -/** - * 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 { +class Referencer extends TSESLintScope.Referencer { protected typeMode: boolean; constructor( @@ -229,10 +150,37 @@ class Referencer extends TSESLintScope.Referencer { * @param node The class node to visit. */ visitClass(node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void { + if (node.type === AST_NODE_TYPES.ClassDeclaration && node.id) { + this.currentScope().__define( + node.id, + new TSESLintScope.Definition( + 'ClassName', + node.id, + node, + null, + null, + null, + ), + ); + } + this.visitDecorators(node.decorators); + this.visit(node.superClass); + + this.scopeManager.__nestClassScope(node); + + if (node.id) { + this.currentScope().__define( + node.id, + new TSESLintScope.Definition('ClassName', node.id, node), + ); + } const upperTypeMode = this.typeMode; this.typeMode = true; + if (node.typeParameters) { + this.visit(node.typeParameters); + } if (node.superTypeParameters) { this.visit(node.superTypeParameters); } @@ -241,7 +189,9 @@ class Referencer extends TSESLintScope.Referencer { } this.typeMode = upperTypeMode; - super.visitClass(node); + this.visit(node.body); + + this.close(node); } /** @@ -276,9 +226,13 @@ class Referencer extends TSESLintScope.Referencer { * @param node The Identifier node to visit. */ Identifier(node: TSESTree.Identifier): void { + const currentScope = this.currentScope(); + this.visitDecorators(node.decorators); - if (!this.typeMode) { + if (this.typeMode) { + typeReferencing(currentScope, node); + } else { super.Identifier(node); } @@ -455,7 +409,31 @@ class Referencer extends TSESLintScope.Referencer { * @param node The TSInterfaceDeclaration node to visit. */ TSInterfaceDeclaration(node: TSESTree.TSInterfaceDeclaration): void { - this.visitTypeNodes(node); + const upperTypeMode = this.typeMode; + this.typeMode = true; + + const scopeManager = this.scopeManager; + const scope = this.currentScope(); + + if (node.id) { + scope.__defineType( + node.id, + new TypeDefinition('InterfaceName', node.id, node, null, null, null), + ); + } + + scopeManager.__nestInterfaceScope(node); + + this.visit(node.typeParameters); + + if (node.extends) { + node.extends.forEach(this.visit, this); + } + + this.visit(node.body); + this.close(node); + + this.typeMode = upperTypeMode; } /** @@ -473,7 +451,23 @@ class Referencer extends TSESLintScope.Referencer { * @param node The TSIndexSignature node to visit. */ TSIndexSignature(node: TSESTree.TSIndexSignature): void { - this.visitTypeNodes(node); + const upperType = this.typeMode; + this.typeMode = true; + let i: number; + let iz: number; + + // Process parameter declarations. + for (i = 0, iz = node.parameters.length; i < iz; ++i) { + this.visitPattern( + node.parameters[i], + { processRightHandNodes: true }, + () => {}, + ); + } + + this.visit(node.typeAnnotation); + + this.typeMode = upperType; } /** @@ -521,7 +515,23 @@ class Referencer extends TSESLintScope.Referencer { * @param node The TSTypeParameterDeclaration node to visit. */ TSTypeParameterDeclaration(node: TSESTree.TSTypeParameterDeclaration): void { - this.visitTypeNodes(node); + let i: number, iz: number; + + // Process parameter declarations. + for (i = 0, iz = node.params.length; i < iz; ++i) { + this.visitPattern( + node.params[i], + { processRightHandNodes: true }, + (pattern, info) => { + this.currentScope().__defineType( + pattern, + new TypeDefinition('TypeParameter', pattern, node, null, i), + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + }, + ); + } } /** @@ -643,18 +653,14 @@ class Referencer extends TSESLintScope.Referencer { */ TSPropertySignature(node: TSESTree.TSPropertySignature): void { const upperTypeMode = this.typeMode; - const { computed, key, typeAnnotation, initializer } = node; + this.typeMode = true; - if (computed) { - this.typeMode = false; - this.visit(key); - this.typeMode = true; - } else { - this.typeMode = true; - this.visit(key); + if (node.computed) { + this.visit(node.key); } - this.visit(typeAnnotation); - this.visit(initializer); + + this.visit(node.typeAnnotation); + this.visit(node.initializer); this.typeMode = upperTypeMode; } @@ -664,22 +670,25 @@ class Referencer extends TSESLintScope.Referencer { * @param node The TSMethodSignature node to visit. */ TSMethodSignature(node: TSESTree.TSMethodSignature): void { - const upperTypeMode = this.typeMode; - const { computed, key, typeParameters, params, returnType } = node; + this.visitTypeFunctionSignature(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); + TSConstructorType(node: TSESTree.TSConstructorType): void { + this.visitTypeFunctionSignature(node); + } - this.typeMode = upperTypeMode; + TSConstructSignatureDeclaration( + node: TSESTree.TSConstructSignatureDeclaration, + ): void { + this.visitTypeFunctionSignature(node); + } + + TSCallSignatureDeclaration(node: TSESTree.TSCallSignatureDeclaration): void { + this.visitTypeFunctionSignature(node); + } + + TSFunctionType(node: TSESTree.TSFunctionType): void { + this.visitTypeFunctionSignature(node); } /** @@ -772,9 +781,39 @@ class Referencer extends TSESLintScope.Referencer { } TSTypeAliasDeclaration(node: TSESTree.TSTypeAliasDeclaration): void { + const upperTypeMode = this.typeMode; this.typeMode = true; - this.visitChildren(node); - this.typeMode = false; + + const scopeManager = this.scopeManager; + const scope = this.currentScope(); + + if (node.id && node.id.type === AST_NODE_TYPES.Identifier) { + scope.__defineType( + node.id, + new TSESLintScope.Definition( + 'TypeAliasName', + node.id, + node, + null, + null, + 'type', + ), + ); + } + + scopeManager.__nestTypeAliasScope(node); + + if (node.typeParameters) { + this.visit(node.typeParameters); + } + + if (node.typeAnnotation) { + this.visit(node.typeAnnotation); + } + + this.close(node); + + this.typeMode = upperTypeMode; } /** @@ -790,6 +829,7 @@ class Referencer extends TSESLintScope.Referencer { TSAbstractClassProperty(node: TSESTree.TSAbstractClassProperty): void { this.ClassProperty(node); } + TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void { this.MethodDefinition(node); } @@ -825,11 +865,7 @@ class Referencer extends TSESLintScope.Referencer { 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; + scopeManager.__currentScope = scopeManager.globalScope; // Skip TSModuleBlock to avoid to create that block scope. if (node.body && node.body.type === AST_NODE_TYPES.TSModuleBlock) { @@ -837,7 +873,6 @@ class Referencer extends TSESLintScope.Referencer { } scopeManager.__currentScope = currentScope; - globalScope.__define = originalDefine; } /** @@ -863,6 +898,64 @@ class Referencer extends TSESLintScope.Referencer { this.typeMode = false; } } + + /** + * Create reference objects for the references in computed keys. + * @param node The TSMethodSignature node to visit. + */ + visitTypeFunctionSignature( + node: + | TSESTree.TSMethodSignature + | TSESTree.TSConstructorType + | TSESTree.TSConstructSignatureDeclaration + | TSESTree.TSCallSignatureDeclaration + | TSESTree.TSFunctionType, + ): void { + const upperTypeMode = this.typeMode; + this.typeMode = true; + + if (node.type === AST_NODE_TYPES.TSMethodSignature) { + if (node.computed) { + this.visit(node.key); + } + } + + this.visit(node.typeParameters); + node.params.forEach(this.visit, this); + this.visit(node.returnType); + + this.typeMode = upperTypeMode; + } + + /** + * @param node + */ + visitProperty( + node: + | TSESTree.MethodDefinition + | TSESTree.TSAbstractMethodDefinition + | TSESTree.Property, + ): void { + let previous = false; + + if (node.computed) { + this.visit(node.key); + } + + const isMethodDefinition = + node.type === AST_NODE_TYPES.MethodDefinition || + node.type === AST_NODE_TYPES.TSAbstractMethodDefinition; + + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + if ('value' in node) { + this.visit(node.value); + } + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + } } export function analyzeScope( diff --git a/packages/parser/src/scope/TypeDefinition.ts b/packages/parser/src/scope/TypeDefinition.ts new file mode 100644 index 000000000000..3f53c341097e --- /dev/null +++ b/packages/parser/src/scope/TypeDefinition.ts @@ -0,0 +1,26 @@ +import { TSESLintScope } from '@typescript-eslint/experimental-utils'; +import { TSESTree } from '@typescript-eslint/typescript-estree'; + +/** + * @class ParameterDefinition + */ +export class TypeDefinition extends TSESLintScope.Definition { + /** + * Whether the parameter definition is a type definition. + * @member {boolean} ParameterDefinition#typeMode + */ + typeMode: boolean; + + constructor( + type: string, + name: TSESTree.BindingName | TSESTree.PropertyName, + node: TSESTree.Node, + parent?: TSESTree.Node | null, + index?: number | null, + kind?: string | null, + ) { + super(type, name, node, parent, index, kind); + + this.typeMode = true; + } +} diff --git a/packages/parser/src/scope/pattern-visitor.ts b/packages/parser/src/scope/pattern-visitor.ts new file mode 100644 index 000000000000..db09634d5f96 --- /dev/null +++ b/packages/parser/src/scope/pattern-visitor.ts @@ -0,0 +1,84 @@ +import { + TSESTree, + AST_NODE_TYPES, + TSESLintScope, +} from '@typescript-eslint/experimental-utils'; + +export class PatternVisitor extends TSESLintScope.PatternVisitor { + constructor( + options: TSESLintScope.PatternVisitorOptions, + rootPattern: TSESTree.BaseNode, + callback: TSESLintScope.PatternVisitorCallback, + ) { + super(options, rootPattern, callback); + } + + static isPattern(node: TSESTree.Node): boolean { + const nodeType = node.type; + + return ( + TSESLintScope.PatternVisitor.isPattern(node) || + nodeType === AST_NODE_TYPES.TSParameterProperty || + nodeType === AST_NODE_TYPES.TSTypeParameter + ); + } + + 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); + } + } + + TSTypeParameter(node: TSESTree.TSTypeParameter): void { + this.visit(node.name); + + if (node.constraint) { + this.rightHandNodes.push(node.constraint); + } + if (node.default) { + this.rightHandNodes.push(node.default); + } + } +} diff --git a/packages/parser/src/scope/scope-manager.ts b/packages/parser/src/scope/scope-manager.ts index c179bd512d3d..891b986ac63b 100644 --- a/packages/parser/src/scope/scope-manager.ts +++ b/packages/parser/src/scope/scope-manager.ts @@ -1,28 +1,112 @@ import { TSESTree, TSESLintScope } from '@typescript-eslint/experimental-utils'; -import { EmptyFunctionScope, EnumScope } from './scopes'; +import { + Scope, + EmptyFunctionScope, + EnumScope, + InterfaceScope, + TypeAliasScope, + GlobalScope, + ModuleScope, + FunctionExpressionNameScope, + SwitchScope, + CatchScope, + WithScope, + BlockScope, + ForScope, + FunctionScope, + ClassScope, +} from './scopes'; /** * based on eslint-scope */ -export class ScopeManager extends TSESLintScope.ScopeManager { - scopes!: TSESLintScope.Scope[]; - globalScope!: TSESLintScope.Scope; +export class ScopeManager extends TSESLintScope.ScopeManager { + scopes!: Scope[]; + globalScope!: Scope; constructor(options: TSESLintScope.ScopeManagerOptions) { super(options); } /** @internal */ - __nestEnumScope(node: TSESTree.TSEnumDeclaration): TSESLintScope.Scope { + __nestEnumScope(node: TSESTree.TSEnumDeclaration): Scope { return this.__nestScope(new EnumScope(this, this.__currentScope, node)); } /** @internal */ - __nestEmptyFunctionScope( - node: TSESTree.TSDeclareFunction, - ): TSESLintScope.Scope { + __nestEmptyFunctionScope(node: TSESTree.TSDeclareFunction): Scope { return this.__nestScope( new EmptyFunctionScope(this, this.__currentScope, node), ); } + + /** @internal */ + __nestInterfaceScope(node: TSESTree.TSInterfaceDeclaration): Scope { + return this.__nestScope( + new InterfaceScope(this, this.__currentScope, node), + ); + } + + /** @internal */ + __nestTypeAliasScope(node: TSESTree.TSTypeAliasDeclaration): Scope { + return this.__nestScope( + new TypeAliasScope(this, this.__currentScope, node), + ); + } + + /// eslint scopes + + /** @internal */ + __nestGlobalScope(node: TSESTree.Node): Scope { + return this.__nestScope(new GlobalScope(this, node)); + } + + /** @internal */ + __nestBlockScope(node: TSESTree.Node): Scope { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): Scope { + return this.__nestScope( + new FunctionScope(this, this.__currentScope, node, isMethodDefinition), + ); + } + + /** @internal */ + __nestForScope(node: TSESTree.Node): Scope { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestCatchScope(node: TSESTree.Node): Scope { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestWithScope(node: TSESTree.Node): Scope { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestClassScope(node: TSESTree.Node): Scope { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestSwitchScope(node: TSESTree.Node): Scope { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestModuleScope(node: TSESTree.Node): Scope { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestFunctionExpressionNameScope(node: TSESTree.Node): Scope { + return this.__nestScope( + new FunctionExpressionNameScope(this, this.__currentScope, node), + ); + } } diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index 4ddaa297d535..f21b8e55dbb7 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -1,11 +1,106 @@ -import { TSESTree, TSESLintScope } from '@typescript-eslint/experimental-utils'; +import { + TSESTree, + TSESLintScope, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; import { ScopeManager } from './scope-manager'; +function defineType( + this: Scope, + node: TSESTree.Node, + def: TSESLintScope.Definition, +): void { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); + } +} + +function resolveType(this: Scope, ref: TSESLintScope.Reference): boolean { + const name = ref.identifier.name; + + if (!this.setTypes.has(name)) { + return false; + } + const variable = this.setTypes.get(name); + + if (!this.__isValidResolution(ref, variable)) { + return false; + } + variable.references.push(ref); + variable.stack = + variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + + return true; +} + +function resolveTypeLike(this: Scope, ref: TSESLintScope.Reference): boolean { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + if (!this.__isValidResolution(ref, variable)) { + return false; + } + + if ( + !variable.defs.some( + d => + d.type === 'ClassName' || + d.type === 'EnumName' || + d.type === 'ImportBinding', + ) + ) { + return false; + } + + variable.references.push(ref); + variable.stack = + variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + return true; +} + +export class Scope extends TSESLintScope.Scope { + setTypes: Map = new Map(); + + /** @internal */ + __defineType = defineType; + + /** @internal */ + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } + + return super.__shouldStaticallyCloseForGlobal(ref); + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode) { + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); + } + return super.__resolve(ref); + } +} + /** The scope class for enum. */ -export class EnumScope extends TSESLintScope.Scope { +export class EnumScope extends Scope { constructor( scopeManager: ScopeManager, - upperScope: TSESLintScope.Scope, + upperScope: Scope, block: TSESTree.TSEnumDeclaration | null, ) { super(scopeManager, 'enum', upperScope, block, false); @@ -13,12 +108,226 @@ export class EnumScope extends TSESLintScope.Scope { } /** The scope class for empty functions. */ -export class EmptyFunctionScope extends TSESLintScope.Scope { +export class EmptyFunctionScope extends Scope { constructor( scopeManager: ScopeManager, - upperScope: TSESLintScope.Scope, + upperScope: Scope, block: TSESTree.TSDeclareFunction | null, ) { super(scopeManager, 'empty-function', upperScope, block, false); } } + +export class InterfaceScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.TSInterfaceDeclaration | null, + ) { + super(scopeManager, 'interface', upperScope, block, false); + } +} + +export class TypeAliasScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.TSTypeAliasDeclaration | null, + ) { + super(scopeManager, 'type-alias', upperScope, block, false); + } +} + +/// eslint scopes + +export class GlobalScope extends TSESLintScope.GlobalScope implements Scope { + setTypes: Map = new Map(); + + /** @internal */ + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } + + return super.__shouldStaticallyCloseForGlobal(ref); + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode) { + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); + } + return super.__resolve(ref); + } + + /** @internal */ + __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); + + // Set `variable.eslintUsed` to tell ESLint that the variable is exported. + const variable = this.set.get(node.name); + if (variable) { + variable.eslintUsed = true; + } + } + } + + /** @internal */ + __define( + node: TSESTree.Identifier, + definition: TSESLintScope.Definition, + ): void { + if (node && node.type === AST_NODE_TYPES.Identifier) { + super.__define(node, definition); + + // Set `variable.eslintUsed` to tell ESLint that the variable is exported. + const variable = this.set.get(node.name); + if (variable) { + variable.eslintUsed = true; + } + } + } +} + +export class FunctionExpressionNameScope + extends TSESLintScope.FunctionExpressionNameScope + implements Scope { + setTypes: Map = new Map(); + + /** @internal */ + __defineType = defineType; + + /** @internal */ + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } + + return super.__shouldStaticallyCloseForGlobal(ref); + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode) { + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); + } + return super.__resolve(ref); + } +} + +export class WithScope extends TSESLintScope.WithScope implements Scope { + setTypes: Map = new Map(); + + /** @internal */ + __defineType = defineType; + + /** @internal */ + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } + + return super.__shouldStaticallyCloseForGlobal(ref); + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode) { + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); + } + return super.__resolve(ref); + } +} + +export class FunctionScope extends TSESLintScope.FunctionScope + implements Scope { + setTypes: Map = new Map(); + + /** @internal */ + __defineType = defineType; + + /** @internal */ + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } + + return super.__shouldStaticallyCloseForGlobal(ref); + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode) { + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); + } else { + return super.__resolve(ref); + } + } +} + +// eslint simple scopes + +export class ModuleScope extends Scope implements TSESLintScope.ModuleScope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'module', upperScope, block, false); + } +} + +export class CatchScope extends Scope implements TSESLintScope.CatchScope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'catch', upperScope, block, false); + } +} + +export class BlockScope extends Scope implements TSESLintScope.BlockScope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'block', upperScope, block, false); + } +} + +export class SwitchScope extends Scope implements TSESLintScope.SwitchScope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'switch', upperScope, block, false); + } +} + +export class ForScope extends Scope implements TSESLintScope.ForScope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'for', upperScope, block, false); + } +} + +export class ClassScope extends Scope implements TSESLintScope.ClassScope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'class', upperScope, block, false); + } +} diff --git a/packages/parser/src/scope/typeReferencing.ts b/packages/parser/src/scope/typeReferencing.ts new file mode 100644 index 000000000000..dacac342aef9 --- /dev/null +++ b/packages/parser/src/scope/typeReferencing.ts @@ -0,0 +1,38 @@ +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; +import { TSESLintScope } from '@typescript-eslint/experimental-utils'; + +/** @internal */ +export function typeReferencing( + scope: TSESLintScope.Scope, + node: TSESTree.Identifier, + assign?: TSESLintScope.ReferenceFlag, + writeExpr?: TSESTree.Node | null, + maybeImplicitGlobal?: boolean, + partial?: boolean, + init?: boolean, +): void { + // because Array element may be null + if (!node || node.type !== AST_NODE_TYPES.Identifier) { + return; + } + + // Specially handle like `this`. + if (node.name === 'super') { + return; + } + + const ref = new TSESLintScope.Reference( + node, + scope, + assign ?? TSESLintScope.Reference.READ, + writeExpr, + maybeImplicitGlobal, + !!partial, + !!init, + ); + + ref.typeMode = true; + + scope.references.push(ref); + scope.__left.push(ref); +} diff --git a/packages/parser/tests/fixtures/scope-analysis/class-with-type-extends-default.ts b/packages/parser/tests/fixtures/scope-analysis/class-with-type-extends-default.ts new file mode 100644 index 000000000000..27af80fa498c --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/class-with-type-extends-default.ts @@ -0,0 +1 @@ +export class Bar {} diff --git a/packages/parser/tests/fixtures/scope-analysis/empty-body-function.ts b/packages/parser/tests/fixtures/scope-analysis/empty-body-function.ts new file mode 100644 index 000000000000..731b9ec178a9 --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/empty-body-function.ts @@ -0,0 +1 @@ +function eachr(subject: Map): typeof subject; diff --git a/packages/parser/tests/fixtures/scope-analysis/mixed-variable-ref.ts b/packages/parser/tests/fixtures/scope-analysis/mixed-variable-ref.ts new file mode 100644 index 000000000000..a6a7723cd610 --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/mixed-variable-ref.ts @@ -0,0 +1,2 @@ +const foo = 2; +new test(); diff --git a/packages/parser/tests/fixtures/scope-analysis/typed-this.src.ts b/packages/parser/tests/fixtures/scope-analysis/typed-this.src.ts new file mode 100644 index 000000000000..60c279230003 --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/typed-this.src.ts @@ -0,0 +1 @@ +function test(this: String) {} diff --git a/packages/parser/tests/lib/__snapshots__/basics.ts.snap b/packages/parser/tests/lib/__snapshots__/basics.ts.snap index 9678bad3ecee..2020b01681ad 100644 --- a/packages/parser/tests/lib/__snapshots__/basics.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/basics.ts.snap @@ -48,6 +48,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -67,6 +68,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -142,6 +144,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -202,6 +205,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -278,6 +282,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -323,6 +328,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -392,6 +398,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -449,6 +456,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -605,6 +613,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -662,6 +671,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -681,6 +691,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -738,6 +749,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -757,6 +769,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -802,6 +815,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -853,6 +867,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -917,6 +932,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -952,6 +968,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -967,6 +984,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1036,6 +1054,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -1112,6 +1131,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -1232,6 +1252,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1267,6 +1288,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1282,6 +1304,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { diff --git a/packages/parser/tests/lib/__snapshots__/javascript.ts.snap b/packages/parser/tests/lib/__snapshots__/javascript.ts.snap index 495f3b26b053..beedbf8951a8 100644 --- a/packages/parser/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/javascript.ts.snap @@ -68,6 +68,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -90,6 +91,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -125,6 +127,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -140,6 +143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -185,6 +189,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -222,6 +227,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -241,6 +247,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -286,6 +293,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -411,6 +419,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -430,6 +439,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -475,6 +485,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -490,6 +501,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -505,6 +517,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -550,6 +563,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -619,6 +633,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -679,6 +694,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -694,6 +710,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -739,6 +756,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -799,6 +817,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -814,6 +833,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -859,6 +879,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -919,6 +940,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -934,6 +956,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -979,6 +1002,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1066,6 +1090,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1081,6 +1106,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1162,6 +1188,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1226,6 +1253,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1241,6 +1269,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1286,6 +1315,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1373,6 +1403,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1388,6 +1419,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1433,6 +1465,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1493,6 +1526,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1508,6 +1542,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1553,6 +1588,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1613,6 +1649,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1628,6 +1665,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1673,6 +1711,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1733,6 +1772,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1748,6 +1788,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1793,6 +1834,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1896,6 +1938,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1911,6 +1954,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1956,6 +2000,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2059,6 +2104,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2074,6 +2120,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2119,6 +2166,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2222,6 +2270,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2237,6 +2286,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2282,6 +2332,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -2342,6 +2393,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2357,6 +2409,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2402,6 +2455,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -2462,6 +2516,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2477,6 +2532,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2522,6 +2578,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2563,6 +2620,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2633,6 +2691,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2700,6 +2759,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2764,6 +2824,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2779,6 +2840,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2824,6 +2886,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -2884,6 +2947,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2899,6 +2963,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2944,6 +3009,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3047,6 +3113,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3062,6 +3129,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3107,6 +3175,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3210,6 +3279,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3225,6 +3295,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3270,6 +3341,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -3330,6 +3402,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3345,6 +3418,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3390,6 +3464,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -3450,6 +3525,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3465,6 +3541,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3510,6 +3587,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3613,6 +3691,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3628,6 +3707,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3673,6 +3753,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -3733,6 +3814,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3748,6 +3830,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3803,6 +3886,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3863,6 +3947,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3923,6 +4008,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -3938,6 +4024,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4055,6 +4142,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4166,6 +4254,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4230,6 +4319,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -4245,6 +4335,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4290,6 +4381,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -4350,6 +4442,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -4365,6 +4458,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4410,6 +4504,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -4470,6 +4565,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -4485,6 +4581,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4552,6 +4649,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -4616,6 +4714,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -4635,6 +4734,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4771,6 +4871,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -5000,6 +5101,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5057,6 +5159,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -5076,6 +5179,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5151,6 +5255,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -5211,6 +5316,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -5287,6 +5393,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5332,6 +5439,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -5401,6 +5509,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -5458,6 +5567,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -5614,6 +5724,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5671,6 +5782,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -5690,6 +5802,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5747,6 +5860,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -5766,6 +5880,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5811,6 +5926,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -5862,6 +5978,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -5926,6 +6043,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6062,6 +6180,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -6291,6 +6410,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6326,6 +6446,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -6341,6 +6462,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6410,6 +6532,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -6486,6 +6609,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -6606,6 +6730,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6641,6 +6766,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -6656,6 +6782,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6691,6 +6818,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -6706,6 +6834,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6741,6 +6870,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -6756,6 +6886,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6791,6 +6922,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -6806,6 +6938,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6841,6 +6974,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -6856,6 +6990,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6893,6 +7028,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -6908,6 +7044,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6943,6 +7080,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -6958,6 +7096,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7041,6 +7180,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7115,6 +7255,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7198,6 +7339,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7272,6 +7414,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7343,6 +7486,7 @@ Object { ], "throughReferences": Array [], "type": "switch", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7435,6 +7579,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -7454,6 +7599,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7511,6 +7657,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -7530,6 +7677,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7587,6 +7735,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -7606,6 +7755,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7661,6 +7811,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -7692,6 +7843,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7723,6 +7875,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -7738,6 +7891,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7815,6 +7969,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -7837,6 +7992,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7894,6 +8050,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -7913,6 +8070,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7968,6 +8126,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -8008,6 +8167,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -8082,6 +8242,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -8142,6 +8303,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -8202,6 +8364,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8257,6 +8420,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -8310,6 +8474,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -8374,6 +8539,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -8438,6 +8604,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8483,6 +8650,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -8498,6 +8666,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -8513,6 +8682,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8568,6 +8738,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -8599,6 +8770,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -8659,6 +8831,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -8719,6 +8892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8774,6 +8948,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -8805,6 +8980,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -8865,6 +9041,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -8925,6 +9102,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8980,6 +9158,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9011,6 +9190,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9071,6 +9251,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -9131,6 +9312,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9186,6 +9368,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9217,6 +9400,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9277,6 +9461,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -9337,6 +9522,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9392,6 +9578,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9423,6 +9610,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9483,6 +9671,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -9543,6 +9732,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9598,6 +9788,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9629,6 +9820,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9689,6 +9881,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -9749,6 +9942,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9804,6 +9998,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9835,6 +10030,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9895,6 +10091,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -9955,6 +10152,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10010,6 +10208,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -10041,6 +10240,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -10101,6 +10301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -10161,6 +10362,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10216,6 +10418,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -10256,6 +10459,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -10296,6 +10500,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -10370,6 +10575,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -10430,6 +10636,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -10490,6 +10697,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10545,6 +10753,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -10585,6 +10794,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -10658,6 +10868,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -10725,6 +10936,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -10792,6 +11004,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10847,6 +11060,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -10887,6 +11101,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -10918,6 +11133,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -10978,6 +11194,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -11038,6 +11255,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11093,6 +11311,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11133,6 +11352,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11164,6 +11384,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11224,6 +11445,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -11284,6 +11506,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11339,6 +11562,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11379,6 +11603,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11410,6 +11635,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11470,6 +11696,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -11530,6 +11757,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11585,6 +11813,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11625,6 +11854,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11656,6 +11886,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11716,6 +11947,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -11776,6 +12008,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11831,6 +12064,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11871,6 +12105,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11902,6 +12137,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11962,6 +12198,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -12022,6 +12259,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12077,6 +12315,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -12117,6 +12356,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -12148,6 +12388,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -12208,6 +12449,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -12268,6 +12510,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12323,6 +12566,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -12354,6 +12598,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -12414,6 +12659,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -12474,6 +12720,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12529,6 +12776,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -12646,6 +12894,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -12706,6 +12955,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -12766,6 +13016,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12821,6 +13072,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -12852,6 +13104,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -12912,6 +13165,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -12972,6 +13226,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13019,6 +13274,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13105,6 +13361,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -13175,6 +13432,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13220,6 +13478,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -13235,6 +13494,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -13250,6 +13510,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13295,6 +13556,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -13355,6 +13617,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13415,6 +13678,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13460,6 +13724,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -13520,6 +13785,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13580,6 +13846,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13625,6 +13892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -13685,6 +13953,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13745,6 +14014,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13790,6 +14060,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -13850,6 +14121,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13910,6 +14182,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13955,6 +14228,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -13970,6 +14244,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -13985,6 +14260,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14040,6 +14316,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -14071,6 +14348,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14131,6 +14409,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -14191,6 +14470,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14238,6 +14518,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -14298,6 +14579,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -14313,6 +14595,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14358,6 +14641,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -14418,6 +14702,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -14433,6 +14718,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14534,6 +14820,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14611,6 +14898,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14672,6 +14960,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -14742,6 +15031,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14803,6 +15093,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -14873,6 +15164,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15003,6 +15295,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -15097,6 +15390,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -15161,6 +15455,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15222,6 +15517,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15292,6 +15588,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15353,6 +15650,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15423,6 +15721,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15504,6 +15803,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15582,6 +15882,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -15642,6 +15943,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -15702,6 +16004,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15783,6 +16086,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15861,6 +16165,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -15921,6 +16226,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -15981,6 +16287,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16052,6 +16359,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16130,6 +16438,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -16190,6 +16499,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16261,6 +16571,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16367,6 +16678,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -16386,6 +16698,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16457,6 +16770,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16563,6 +16877,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -16582,6 +16897,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16653,6 +16969,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -16843,6 +17160,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -16913,6 +17231,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16970,6 +17289,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16989,6 +17309,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17118,6 +17439,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17146,6 +17468,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17207,6 +17530,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -17277,6 +17601,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17334,6 +17659,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -17353,6 +17679,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17410,6 +17737,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -17429,6 +17757,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17484,6 +17813,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17601,6 +17931,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -17661,6 +17992,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -17721,6 +18053,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17827,6 +18160,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -17952,6 +18286,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -18012,6 +18347,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -18072,6 +18408,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18178,6 +18515,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -18303,6 +18641,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -18363,6 +18702,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -18423,6 +18763,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18478,6 +18819,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -18595,6 +18937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -18655,6 +18998,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -18715,6 +19059,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18770,6 +19115,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -18887,6 +19233,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -18947,6 +19294,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -19007,6 +19355,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19113,6 +19462,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -19238,6 +19588,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -19298,6 +19649,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -19358,6 +19710,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19464,6 +19817,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -19589,6 +19943,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -19649,6 +20004,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -19709,6 +20065,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19764,6 +20121,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -19881,6 +20239,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -19941,6 +20300,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -20001,6 +20361,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20111,6 +20472,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -20136,6 +20498,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20346,6 +20709,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -20535,6 +20899,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20695,6 +21060,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -20878,6 +21244,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21038,6 +21405,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -21221,6 +21589,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21380,6 +21749,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -21513,6 +21883,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21647,6 +22018,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -21777,6 +22149,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21883,6 +22256,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -21959,6 +22333,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22169,6 +22544,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -22358,6 +22734,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22499,6 +22876,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -22527,6 +22905,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22633,6 +23012,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -22709,6 +23089,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22919,6 +23300,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -23108,6 +23490,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23268,6 +23651,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -23451,6 +23835,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23611,6 +23996,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -23794,6 +24180,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23954,6 +24341,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -24137,6 +24525,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24296,6 +24685,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -24429,6 +24819,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24563,6 +24954,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -24693,6 +25085,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24801,6 +25194,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -24835,6 +25229,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -24850,6 +25245,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "catch", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -24909,6 +25305,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -25040,6 +25437,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -25100,6 +25498,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25208,6 +25607,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -25242,6 +25642,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -25257,6 +25658,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "catch", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -25316,6 +25718,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -25447,6 +25850,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -25507,6 +25911,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25584,6 +25989,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -25606,6 +26012,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25690,6 +26097,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -25712,6 +26120,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25798,6 +26207,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25921,6 +26331,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26007,6 +26418,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26130,6 +26542,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26191,6 +26604,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -26261,6 +26675,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26322,6 +26737,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -26392,6 +26808,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26463,6 +26880,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26541,6 +26959,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -26601,6 +27020,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26672,6 +27092,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26750,6 +27171,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -26810,6 +27232,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26906,6 +27329,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27031,6 +27455,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -27091,6 +27516,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27136,6 +27562,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27253,6 +27680,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27313,6 +27741,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27368,6 +27797,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27485,6 +27915,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function-expression-name", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27545,6 +27976,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27560,6 +27992,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27605,6 +28038,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27722,6 +28156,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27782,6 +28217,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27827,6 +28263,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27944,6 +28381,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -28004,6 +28442,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28049,6 +28488,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28166,6 +28606,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -28226,6 +28667,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28271,6 +28713,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28388,6 +28831,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -28448,6 +28892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28503,6 +28948,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28620,6 +29066,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function-expression-name", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -28680,6 +29127,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -28695,6 +29143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28806,6 +29255,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -28831,6 +29281,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28898,6 +29349,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -28962,6 +29414,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -28981,6 +29434,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29046,6 +29500,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29153,6 +29608,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -29168,6 +29624,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29233,6 +29690,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29340,6 +29798,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -29355,6 +29814,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29420,6 +29880,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29527,6 +29988,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -29542,6 +30004,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29609,6 +30072,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -29673,6 +30137,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29692,6 +30157,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29782,6 +30248,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29849,6 +30316,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -29864,6 +30332,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29954,6 +30423,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30021,6 +30491,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30036,6 +30507,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30170,6 +30642,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -30287,6 +30760,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -30302,6 +30776,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30363,6 +30838,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30433,6 +30909,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30494,6 +30971,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30564,6 +31042,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30625,6 +31104,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30695,6 +31175,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30756,6 +31237,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30826,6 +31308,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30887,6 +31370,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30957,6 +31441,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31018,6 +31503,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -31088,6 +31574,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31159,6 +31646,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31237,6 +31725,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31297,6 +31786,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31368,6 +31858,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31474,6 +31965,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31493,6 +31985,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31564,6 +32057,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -31642,6 +32136,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31657,6 +32152,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31728,6 +32224,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -31806,6 +32303,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31821,6 +32319,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31905,6 +32404,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -31927,6 +32427,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32065,6 +32566,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32093,6 +32595,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32231,6 +32734,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32259,6 +32763,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32304,6 +32809,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32464,6 +32970,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -32524,6 +33031,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32662,6 +33170,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32690,6 +33199,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32774,6 +33284,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -32796,6 +33307,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32907,6 +33419,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -32932,6 +33445,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33043,6 +33557,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -33068,6 +33583,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33152,6 +33668,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -33174,6 +33691,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33309,6 +33827,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -33489,6 +34008,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33624,6 +34144,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -33804,6 +34325,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33913,6 +34435,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -34040,6 +34563,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34123,6 +34647,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -34197,6 +34722,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34268,6 +34794,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -34352,6 +34879,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -34412,6 +34940,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34467,6 +34996,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -34507,6 +35037,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -34547,6 +35078,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -34630,6 +35162,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -34661,6 +35194,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -34721,6 +35255,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -34781,6 +35316,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34816,6 +35352,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -34831,6 +35368,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34876,6 +35414,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -34907,6 +35446,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -34967,6 +35507,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35012,6 +35553,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -35046,6 +35588,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -35070,6 +35613,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -35085,6 +35629,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "switch", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -35109,6 +35654,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -35124,6 +35670,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -35139,6 +35686,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35174,6 +35722,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -35189,6 +35738,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35250,6 +35800,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -35320,6 +35871,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35355,6 +35907,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -35421,6 +35974,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35456,6 +36010,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -35471,6 +36026,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35516,6 +36072,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -35547,6 +36104,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -35607,6 +36165,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35672,6 +36231,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -35735,6 +36295,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -35809,6 +36370,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -35844,6 +36406,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -35908,6 +36471,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35965,6 +36529,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -35984,6 +36549,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36029,6 +36595,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -36146,6 +36713,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36206,6 +36774,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36335,6 +36904,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -36363,6 +36933,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36408,6 +36979,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -36482,6 +37054,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -36542,6 +37115,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36679,6 +37253,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -36859,6 +37434,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36970,6 +37546,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -37146,6 +37723,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37264,6 +37842,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -37493,6 +38072,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37538,6 +38118,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -37698,6 +38279,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -37713,6 +38295,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37758,6 +38341,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -37944,6 +38528,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -38014,6 +38599,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38132,6 +38718,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -38361,6 +38948,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38479,6 +39067,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -38708,6 +39297,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38805,6 +39395,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38830,6 +39421,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38948,6 +39540,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -39177,6 +39770,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39222,6 +39816,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39256,6 +39851,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39271,6 +39867,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "catch", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39286,6 +39883,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39301,6 +39899,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39346,6 +39945,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39380,6 +39980,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39395,6 +39996,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "catch", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39419,6 +40021,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39434,6 +40037,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39449,6 +40053,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39535,6 +40140,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39608,6 +40214,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39643,6 +40250,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -39658,6 +40266,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39703,6 +40312,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39782,6 +40392,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -39858,6 +40469,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39903,6 +40515,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -40045,6 +40658,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -40180,6 +40794,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40235,6 +40850,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -40316,6 +40932,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -40393,6 +41010,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -40412,6 +41030,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40547,6 +41166,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -40575,6 +41195,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40630,6 +41251,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -40711,6 +41333,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -40788,6 +41411,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -40807,6 +41431,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40852,6 +41477,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40895,6 +41521,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -40914,6 +41541,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40983,6 +41611,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -41163,6 +41792,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -41404,6 +42034,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41449,6 +42080,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -41538,6 +42170,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -41665,6 +42298,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41710,6 +42344,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -41799,6 +42434,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -41926,6 +42562,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41973,6 +42610,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42016,6 +42654,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -42035,6 +42674,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42192,6 +42832,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -42275,6 +42916,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -42297,6 +42939,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42407,6 +43050,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -42432,6 +43076,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42564,6 +43209,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -42644,6 +43290,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -42666,6 +43313,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42821,6 +43469,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -42904,6 +43553,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42949,6 +43599,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -43040,6 +43691,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -43065,6 +43717,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43187,6 +43840,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -43267,6 +43921,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43359,6 +44014,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -43433,6 +44089,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -43452,6 +44109,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43497,6 +44155,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -43586,6 +44245,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -43713,6 +44373,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43758,6 +44419,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -43847,6 +44509,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -43974,6 +44637,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44066,6 +44730,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -44140,6 +44805,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -44159,6 +44825,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44204,6 +44871,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -44348,6 +45016,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -44431,6 +45100,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44476,6 +45146,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -44567,6 +45238,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -44592,6 +45264,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44659,6 +45332,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -44725,6 +45399,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -44802,6 +45477,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44905,6 +45581,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -44982,6 +45659,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45095,6 +45773,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -45172,6 +45851,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -45194,6 +45874,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45307,6 +45988,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -45384,6 +46066,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -45406,6 +46089,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45509,6 +46193,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -45681,6 +46366,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -45741,6 +46427,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45844,6 +46531,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -46016,6 +46704,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -46076,6 +46765,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46143,6 +46833,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46178,6 +46869,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -46197,6 +46889,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46242,6 +46935,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46273,6 +46967,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -46333,6 +47028,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46435,6 +47131,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -46523,6 +47220,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -46587,6 +47285,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -46651,6 +47350,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46696,6 +47396,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46727,6 +47428,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46742,6 +47444,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46787,6 +47490,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46818,6 +47522,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -46878,6 +47583,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46945,6 +47651,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -46980,6 +47687,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -47044,6 +47752,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47111,6 +47820,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47146,6 +47856,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47165,6 +47876,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47210,6 +47922,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -47241,6 +47954,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47256,6 +47970,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47323,6 +48038,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47358,6 +48074,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47377,6 +48094,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47422,6 +48140,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -47453,6 +48172,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47468,6 +48188,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47525,6 +48246,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -47544,6 +48266,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47579,6 +48302,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47594,6 +48318,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47629,6 +48354,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47644,6 +48370,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47681,6 +48408,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47696,6 +48424,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47731,6 +48460,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47746,6 +48476,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47781,6 +48512,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47796,6 +48528,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47841,6 +48574,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47856,6 +48590,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -47871,6 +48606,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47916,6 +48652,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47931,6 +48668,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -47946,6 +48684,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48001,6 +48740,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -48071,6 +48811,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48138,6 +48879,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -48173,6 +48915,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -48237,6 +48980,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48334,6 +49078,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -48356,6 +49101,7 @@ Object { }, ], "type": "with", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -48398,6 +49144,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -48475,6 +49222,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48520,6 +49268,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -48551,6 +49300,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -48611,6 +49361,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48672,6 +49423,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -48742,6 +49494,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48777,6 +49530,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48792,6 +49546,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48837,6 +49592,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -48868,6 +49624,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -48928,6 +49685,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48973,6 +49731,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48988,6 +49747,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -49003,6 +49763,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49038,6 +49799,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49053,6 +49815,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49098,6 +49861,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -49129,6 +49893,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49144,6 +49909,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49189,6 +49955,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49249,6 +50016,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -49309,6 +50077,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49354,6 +50123,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49385,6 +50155,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -49445,6 +50216,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49480,6 +50252,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49495,6 +50268,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49530,6 +50304,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49545,6 +50320,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49602,6 +50378,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -49621,6 +50398,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49656,6 +50434,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49671,6 +50450,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49706,6 +50486,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49721,6 +50502,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49756,6 +50538,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49771,6 +50554,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49806,6 +50590,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49821,6 +50606,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49856,6 +50642,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49871,6 +50658,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49906,6 +50694,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49921,6 +50710,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49956,6 +50746,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49971,6 +50762,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50016,6 +50808,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50047,6 +50840,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -50107,6 +50901,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50168,6 +50963,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50238,6 +51034,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50295,6 +51092,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50314,6 +51112,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50371,6 +51170,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50390,6 +51190,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50467,6 +51268,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50489,6 +51291,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50534,6 +51337,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50594,6 +51398,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -50654,6 +51459,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50689,6 +51495,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -50704,6 +51511,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50761,6 +51569,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50780,6 +51589,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50857,6 +51667,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50879,6 +51690,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50956,6 +51768,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50978,6 +51791,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51013,6 +51827,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51079,6 +51894,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51124,6 +51940,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -51181,6 +51998,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -51251,6 +52069,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51312,6 +52131,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -51382,6 +52202,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51417,6 +52238,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51483,6 +52305,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51518,6 +52341,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -51633,6 +52457,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51668,6 +52493,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -51783,6 +52609,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51818,6 +52645,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51884,6 +52712,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51919,6 +52748,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51985,6 +52815,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52020,6 +52851,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -52035,6 +52867,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52070,6 +52903,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52136,6 +52970,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52171,6 +53006,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -52286,6 +53122,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52321,6 +53158,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -52336,6 +53174,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52371,6 +53210,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52437,6 +53277,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52472,6 +53313,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -52587,6 +53429,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52622,6 +53465,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -52737,6 +53581,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52772,6 +53617,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52838,6 +53684,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52873,6 +53720,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52939,6 +53787,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52974,6 +53823,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -53040,6 +53890,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53085,6 +53936,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -53100,6 +53952,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -53115,6 +53968,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53182,6 +54036,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -53201,6 +54056,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53248,6 +54104,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -53314,6 +54171,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53351,6 +54209,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -53366,6 +54225,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53441,6 +54301,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -53511,6 +54372,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53556,6 +54418,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -53613,6 +54476,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -53683,6 +54547,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53754,6 +54619,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -53838,6 +54704,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -53898,6 +54765,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53975,6 +54843,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -53997,6 +54866,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54079,6 +54949,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -54153,6 +55024,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54210,6 +55082,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -54229,6 +55102,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54274,6 +55148,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -54314,6 +55189,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -54430,6 +55306,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -54452,6 +55329,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54534,6 +55412,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -54608,6 +55487,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54710,6 +55590,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -54787,6 +55668,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54848,6 +55730,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -54867,6 +55750,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54902,6 +55786,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -54917,6 +55802,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54962,6 +55848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55015,6 +55902,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -55034,6 +55922,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55158,6 +56047,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -55287,6 +56177,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55411,6 +56302,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -55540,6 +56432,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55601,6 +56494,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55671,6 +56565,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55732,6 +56627,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55802,6 +56698,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55871,6 +56768,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -55932,6 +56830,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -56006,6 +56905,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56051,6 +56951,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56110,6 +57011,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -56129,6 +57031,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56174,6 +57077,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56233,6 +57137,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -56252,6 +57157,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56297,6 +57203,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56356,6 +57263,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -56375,6 +57283,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56420,6 +57329,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -56522,6 +57432,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -56541,6 +57452,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56586,6 +57498,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56645,6 +57558,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -56664,6 +57578,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56731,6 +57646,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -56792,6 +57708,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -56866,6 +57783,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56984,6 +57902,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -57213,6 +58132,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57250,6 +58170,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -57265,6 +58186,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57300,6 +58222,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -57315,6 +58238,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57350,6 +58274,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -57365,6 +58290,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57400,6 +58326,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -57415,6 +58342,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57476,6 +58404,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57546,6 +58475,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57607,6 +58537,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57677,6 +58608,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57738,6 +58670,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57808,6 +58741,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57869,6 +58803,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57939,6 +58874,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58000,6 +58936,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -58070,6 +59007,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58115,6 +59053,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58232,6 +59171,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -58292,6 +59232,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58347,6 +59288,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58421,6 +59363,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -58481,6 +59424,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -58541,6 +59485,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58596,6 +59541,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58670,6 +59616,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -58730,6 +59677,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -58790,6 +59738,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58835,6 +59784,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -58938,6 +59888,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58998,6 +59949,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59043,6 +59995,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -59189,6 +60142,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -59249,6 +60203,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59294,6 +60249,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -59394,6 +60350,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -59464,6 +60421,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59509,6 +60467,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -59652,6 +60611,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -59722,6 +60682,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59767,6 +60728,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -59841,6 +60803,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -59901,6 +60864,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59946,6 +60910,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -60020,6 +60985,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -60080,6 +61046,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60141,6 +61108,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60211,6 +61179,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60272,6 +61241,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60342,6 +61312,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60403,6 +61374,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60473,6 +61445,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60534,6 +61507,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60604,6 +61578,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60665,6 +61640,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60735,6 +61711,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60796,6 +61773,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60866,6 +61844,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60949,6 +61928,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -61023,6 +62003,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61323,6 +62304,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -61369,6 +62351,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61470,6 +62453,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -61495,6 +62479,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61592,6 +62577,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -61617,6 +62603,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61694,6 +62681,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -61716,6 +62704,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61773,6 +62762,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -61792,6 +62782,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61827,6 +62818,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -61842,6 +62834,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61903,6 +62896,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -61973,6 +62967,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -62097,6 +63092,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -62226,6 +63222,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -62261,6 +63258,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -62276,6 +63274,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -62311,6 +63310,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -62326,6 +63326,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -62387,6 +63388,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -62457,6 +63459,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -62514,6 +63517,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -62533,6 +63537,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -62619,6 +63624,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -62718,6 +63724,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -62792,6 +63799,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -62827,6 +63835,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -62842,6 +63851,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -62877,6 +63887,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -62892,6 +63903,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { diff --git a/packages/parser/tests/lib/__snapshots__/jsx.ts.snap b/packages/parser/tests/lib/__snapshots__/jsx.ts.snap index 8d9c75da11d7..ef99b8e5c9fd 100644 --- a/packages/parser/tests/lib/__snapshots__/jsx.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/jsx.ts.snap @@ -68,6 +68,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -90,6 +91,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -125,6 +127,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -140,6 +143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -175,6 +179,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -190,6 +195,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -247,6 +253,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -266,6 +273,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -301,6 +309,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -316,6 +325,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -351,6 +361,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -366,6 +377,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -401,6 +413,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -416,6 +429,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -501,6 +515,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -516,6 +531,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -573,6 +589,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -592,6 +609,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -627,6 +645,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -642,6 +661,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -677,6 +697,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -692,6 +713,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -727,6 +749,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -742,6 +765,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -779,6 +803,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -794,6 +819,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -829,6 +855,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -844,6 +871,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -881,6 +909,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -896,6 +925,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -931,6 +961,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -946,6 +977,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -981,6 +1013,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -996,6 +1029,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1053,6 +1087,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1072,6 +1107,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1129,6 +1165,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1148,6 +1185,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1183,6 +1221,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1198,6 +1237,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1233,6 +1273,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1248,6 +1289,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1283,6 +1325,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1298,6 +1341,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1333,6 +1377,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1348,6 +1393,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1405,6 +1451,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1424,6 +1471,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1459,6 +1507,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1474,6 +1523,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1509,6 +1559,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1524,6 +1575,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1559,6 +1611,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1574,6 +1627,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { diff --git a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap index 78db01bfd950..9a8253c9e83e 100644 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap @@ -56,6 +56,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -134,6 +135,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -194,6 +196,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -239,6 +242,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -299,6 +303,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -359,6 +364,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -370,7 +376,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-implements.ts 1`] = ` Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ 0, @@ -380,7 +386,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 8, "block": Object { "range": Array [ 0, @@ -390,7 +396,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 7, "block": Object { "range": Array [ 0, @@ -401,11 +407,97 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Component", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Nullable", + "range": Array [ + 41, + 49, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "SomeOther", + "range": Array [ + 50, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Component2", + "range": Array [ + 67, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "class", + "typeMap": Object { + "Nullable": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -413,7 +505,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { @@ -453,7 +545,51 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 7, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Nullable", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 7, }, }, ], @@ -462,10 +598,21 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 9, }, "variableMap": Object { "Foo": Object { @@ -473,7 +620,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { @@ -513,7 +660,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, ], @@ -522,12 +669,23 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [], } @@ -615,6 +773,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -722,6 +881,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -845,6 +1005,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -856,7 +1017,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-supper-type.ts 1`] = ` Object { - "$id": 13, + "$id": 16, "block": Object { "range": Array [ 0, @@ -866,7 +1027,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 0, @@ -876,7 +1037,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -887,11 +1048,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo": Object { @@ -899,7 +1083,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { @@ -939,13 +1123,13 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], }, Object { - "$id": 9, + "$id": 11, "block": Object { "range": Array [ 42, @@ -956,23 +1140,46 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 10, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo2": Object { - "$ref": 8, + "$ref": 9, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { - "$id": 8, + "$id": 9, "defs": Array [ Object { "name": Object { @@ -1008,13 +1215,13 @@ Object { "name": "Foo2", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 11, }, }, ], }, Object { - "$id": 11, + "$id": 14, "block": Object { "range": Array [ 84, @@ -1025,23 +1232,46 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 107, + 110, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo3": Object { - "$ref": 10, + "$ref": 12, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { - "$id": 10, + "$id": 12, "defs": Array [ Object { "name": Object { @@ -1077,7 +1307,7 @@ Object { "name": "Foo3", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 14, }, }, ], @@ -1089,7 +1319,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1106,7 +1336,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1123,7 +1353,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1142,16 +1372,26 @@ Object { Object { "$ref": 3, }, + Object { + "$ref": 7, + }, Object { "$ref": 4, }, + Object { + "$ref": 10, + }, Object { "$ref": 5, }, + Object { + "$ref": 13, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 13, + "$ref": 16, }, "variableMap": Object { "Foo": Object { @@ -1165,7 +1405,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { @@ -1205,7 +1445,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, Object { @@ -1245,7 +1485,7 @@ Object { "name": "Foo2", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, Object { @@ -1285,7 +1525,7 @@ Object { "name": "Foo3", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, ], @@ -1298,298 +1538,251 @@ Object { Object { "$ref": 3, }, + Object { + "$ref": 7, + }, Object { "$ref": 4, }, + Object { + "$ref": 10, + }, Object { "$ref": 5, }, + Object { + "$ref": 13, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 16, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-with-type-extends-default.ts 1`] = ` Object { - "$id": 9, + "$id": 6, "block": Object { "range": Array [ 0, - 110, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 110, + 39, ], "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, - }, + "childScopes": Array [ 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", + "block": Object { "range": Array [ - 71, - 73, + 7, + 38, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "type": "ClassDeclaration", }, - "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 [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", + "$id": 3, + "from": Object { + "$ref": 4, }, - "parent": Object { + "identifier": Object { + "name": "Foo", "range": Array [ - 0, - 34, + 27, + 30, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", + "$ref": 3, }, ], - "name": "s1", - "references": Array [ - Object { + "type": "class", + "typeMap": Object { + "T": Object { "$ref": 2, }, - Object { - "$ref": 6, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "Bar": Object { + "$ref": 1, }, - ], - "scope": Object { - "$ref": 8, }, - }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 38, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Bar", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 35, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 1, + "$ref": 3, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Bar": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "s2", + "name": "Bar", "range": Array [ - 21, - 23, + 13, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, + 7, + 38, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s2", + "name": "Bar", "range": Array [ - 21, - 23, + 13, + 16, ], "type": "Identifier", }, ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], + "name": "Bar", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 5, }, }, ], @@ -1602,178 +1795,263 @@ Object { Object { "$ref": 3, }, - Object { - "$ref": 5, - }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 6, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` Object { - "$id": 9, + "$id": 13, "block": Object { "range": Array [ 0, - 107, + 110, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 12, "block": Object { "range": Array [ 0, - 107, + 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, - }, + "childScopes": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", + "$id": 11, + "block": Object { "range": Array [ - 51, - 53, + 35, + 109, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 54, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 71, + 73, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 75, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 87, + 97, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "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": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "s2", "range": Array [ - 68, - 70, + 21, + 23, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { "$ref": 1, }, + "writeExpr": Object { + "range": Array [ + 26, + 34, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 9, + "$ref": 13, }, "variableMap": Object { "s1": Object { @@ -1784,7 +2062,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 12, }, "variables": Array [ Object { @@ -1830,14 +2108,11 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 6, + "$ref": 3, }, ], "scope": Object { - "$ref": 8, + "$ref": 12, }, }, Object { @@ -1883,14 +2158,51 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ Object { - "$ref": 7, + "name": Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 109, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", }, ], + "name": "A", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 12, }, }, ], @@ -1901,148 +2213,291 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 13, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` Object { - "$id": 5, + "$id": 13, "block": Object { "range": Array [ 0, - 40, + 107, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 12, "block": Object { "range": Array [ 0, - 40, + 107, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 11, "block": Object { "range": Array [ - 0, - 37, + 35, + 106, ], - "type": "TSDeclareFunction", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 51, + 53, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - }, - "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, + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 68, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 72, + 82, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 84, + 94, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 12, }, "identifier": Object { - "name": "f", + "name": "s1", "range": Array [ - 38, - 39, + 6, + 8, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { "$ref": 0, }, + "writeExpr": Object { + "range": Array [ + 11, + 19, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "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": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 5, + "$ref": 13, }, "variableMap": Object { - "f": Object { + "s1": Object { "$ref": 0, }, + "s2": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 4, + "$ref": 12, }, "variables": Array [ Object { @@ -2050,43 +2505,139 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "s1", "range": Array [ - 17, - 18, + 6, + 8, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 37, + 34, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "s1", "range": Array [ - 17, - 18, + 6, + 8, ], "type": "Identifier", }, ], - "name": "f", + "name": "s1", "references": Array [ Object { - "$ref": 1, + "$ref": 3, }, ], "scope": Object { - "$ref": 4, + "$ref": 12, + }, + }, + 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": 5, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 106, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, }, }, ], @@ -2095,24 +2646,44 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 13, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function.ts 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 70, + 40, ], "type": "Program", }, @@ -2122,7 +2693,7 @@ Object { "block": Object { "range": Array [ 0, - 70, + 40, ], "type": "Program", }, @@ -2132,42 +2703,23 @@ Object { "block": Object { "range": Array [ 0, - 69, + 37, ], "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, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "subject": Object { - "$ref": 1, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { @@ -2175,21 +2727,21 @@ Object { }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "subject", + "name": "a", "range": Array [ - 27, - 51, + 19, + 28, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 69, + 37, ], "type": "TSDeclareFunction", }, @@ -2200,20 +2752,16 @@ Object { "eslintUsed": true, "identifiers": Array [ Object { - "name": "subject", + "name": "a", "range": Array [ - 27, - 51, + 19, + 28, ], "type": "Identifier", }, ], - "name": "subject", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "a", + "references": Array [], "scope": Object { "$ref": 3, }, @@ -2223,14 +2771,35 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "eachr": Object { + "f": Object { "$ref": 0, }, }, @@ -2243,17 +2812,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "eachr", + "name": "f", "range": Array [ - 9, - 14, + 17, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 69, + 37, ], "type": "TSDeclareFunction", }, @@ -2264,16 +2833,20 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "eachr", + "name": "f", "range": Array [ - 9, - 14, + 17, + 18, ], "type": "Identifier", }, ], - "name": "eachr", - "references": Array [], + "name": "f", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { "$ref": 4, }, @@ -2286,6 +2859,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2295,185 +2869,105 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-global.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` Object { - "$id": 3, + "$id": 10, "block": Object { "range": Array [ 0, - 55, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 9, "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, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ - 33, - 92, + 0, + 69, ], - "type": "TSModuleBlock", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, Object { "$id": 5, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { - "name": "a", + "name": "Key", "range": Array [ - 89, - 90, + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Value", + "range": Array [ + 45, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "subject", + "range": Array [ + 61, + 68, ], "type": "Identifier", }, @@ -2484,117 +2978,162 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "block", + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "empty-function", + "typeMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "a": Object { + "subject": Object { "$ref": 3, }, - "b": Object { - "$ref": 4, - }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "Key", "range": Array [ - 52, - 61, + 15, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 52, - 61, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 46, - 61, + 14, + 26, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "Key", "range": Array [ - 52, - 61, + 15, + 18, ], "type": "Identifier", }, ], - "name": "a", + "name": "Key", "references": Array [ Object { "$ref": 5, }, ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, Object { - "$id": 4, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "b", + "name": "Value", "range": Array [ - 79, - 90, + 20, + 25, ], "type": "Identifier", }, "node": Object { "range": Array [ - 79, - 90, + 14, + 26, ], - "type": "VariableDeclarator", + "type": "TSTypeParameterDeclaration", }, - "parent": Object { + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "subject", "range": Array [ - 73, - 90, + 27, + 51, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "node": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "b", + "name": "subject", "range": Array [ - 79, - 90, + 27, + 51, ], "type": "Identifier", }, ], - "name": "b", - "references": Array [], + "name": "subject", + "references": Array [ + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -2602,64 +3141,24 @@ Object { ], "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", - }, - }, + "references": Array [], + "throughReferences": Array [ 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, + "$ref": 4, }, ], - "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { - "a": Object { + "eachr": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -2667,52 +3166,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "eachr", "range": Array [ - 6, - 7, + 9, + 14, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 11, + 69, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "eachr", "range": Array [ - 6, - 7, + 9, + 14, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "name": "eachr", + "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -2721,264 +3207,166 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-global.ts 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 65, + 55, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ 0, - 65, + 55, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 5, - "block": Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "C", "range": Array [ - 15, - 64, + 38, + 39, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "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, - }, + "kind": "w", + "resolved": Object { + "$ref": 0, }, - "variableScope": Object { - "$ref": 6, + "writeExpr": Object { + "range": Array [ + 42, + 43, + ], + "type": "Literal", }, - "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, + "$ref": 1, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "C": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 7, + "$ref": 3, }, - "variables": Array [], + "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/decorator-parameter-property-identifier.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-module.ts 1`] = ` Object { "$id": 8, "block": Object { "range": Array [ 0, - 65, + 95, ], "type": "Program", }, @@ -2988,7 +3376,7 @@ Object { "block": Object { "range": Array [ 0, - 65, + 95, ], "type": "Program", }, @@ -2997,133 +3385,47 @@ Object { "$id": 6, "block": Object { "range": Array [ - 15, - 64, + 33, + 92, ], - "type": "ClassDeclaration", + "type": "TSModuleBlock", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { "$id": 5, - "block": Object { + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "a", "range": Array [ - 40, - 62, + 89, + 90, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "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, + "kind": "r", + "resolved": Object { + "$ref": 3, }, - "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, + "writeExpr": undefined, }, ], - "type": "class", + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "a": Object { + "$ref": 3, + }, + "b": Object { + "$ref": 4, }, }, "variableScope": Object { @@ -3131,40 +3433,96 @@ Object { }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 52, + 61, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 52, + 61, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 46, + 61, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 52, + 61, ], "type": "Identifier", }, ], - "name": "Foo", + "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, @@ -3175,18 +3533,60 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "references": Array [ Object { - "$ref": 4, + "$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", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "Foo": Object { + "a": Object { "$ref": 0, }, }, @@ -3199,39 +3599,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 6, + 11, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 6, + 7, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "scope": Object { + "$ref": 7, }, }, ], @@ -3240,12 +3653,9 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3255,13 +3665,13 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 60, + 65, ], "type": "Program", }, @@ -3271,7 +3681,7 @@ Object { "block": Object { "range": Array [ 0, - 60, + 65, ], "type": "Program", }, @@ -3281,7 +3691,7 @@ Object { "block": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3291,7 +3701,7 @@ Object { "block": Object { "range": Array [ 40, - 57, + 62, ], "type": "FunctionExpression", }, @@ -3323,6 +3733,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -3358,6 +3769,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3385,7 +3797,7 @@ Object { "node": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3422,6 +3834,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3449,7 +3862,7 @@ Object { "node": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3486,6 +3899,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3495,13 +3909,13 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` Object { "$id": 8, "block": Object { "range": Array [ 0, - 82, + 65, ], "type": "Program", }, @@ -3511,7 +3925,7 @@ Object { "block": Object { "range": Array [ 0, - 82, + 65, ], "type": "Program", }, @@ -3521,7 +3935,7 @@ Object { "block": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3531,7 +3945,7 @@ Object { "block": Object { "range": Array [ 40, - 79, + 62, ], "type": "FunctionExpression", }, @@ -3563,6 +3977,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3596,15 +4011,15 @@ Object { "name": Object { "name": "test", "range": Array [ - 63, - 75, + 46, + 58, ], "type": "Identifier", }, "node": Object { "range": Array [ 40, - 79, + 62, ], "type": "FunctionExpression", }, @@ -3617,8 +4032,8 @@ Object { Object { "name": "test", "range": Array [ - 63, - 75, + 46, + 58, ], "type": "Identifier", }, @@ -3641,6 +4056,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3668,7 +4084,7 @@ Object { "node": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3705,6 +4121,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3732,7 +4149,7 @@ Object { "node": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3769,6 +4186,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3778,43 +4196,43 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 70, + 60, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, - 70, + 60, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 15, - 69, + 59, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 40, - 67, + 57, ], "type": "FunctionExpression", }, @@ -3823,9 +4241,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Dec", @@ -3842,23 +4260,21 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { "arguments": Object { "$ref": 2, }, - "test": Object { - "$ref": 3, - }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -3869,47 +4285,7 @@ Object { "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, + "$ref": 4, }, }, ], @@ -3920,12 +4296,13 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -3933,7 +4310,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -3951,7 +4328,7 @@ Object { "node": Object { "range": Array [ 15, - 69, + 59, ], "type": "ClassDeclaration", }, @@ -3973,7 +4350,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -3984,12 +4361,13 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -3997,7 +4375,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -4015,7 +4393,7 @@ Object { "node": Object { "range": Array [ 15, - 69, + 59, ], "type": "ClassDeclaration", }, @@ -4037,7 +4415,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -4048,36 +4426,37 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorators.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` Object { - "$id": 19, + "$id": 8, "block": Object { "range": Array [ 0, - 198, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 18, + "$id": 7, "block": Object { "range": Array [ 0, - 198, + 82, ], "type": "Program", }, @@ -4086,183 +4465,94 @@ Object { "$id": 6, "block": Object { "range": Array [ - 0, - 29, + 15, + 81, ], - "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, + "type": "ClassDeclaration", }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, + "childScopes": Array [ Object { "$id": 5, - "defs": Array [ + "block": Object { + "range": Array [ + 40, + 79, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "target", - "range": Array [ - 13, - 24, - ], - "type": "Identifier", + "$id": 4, + "from": Object { + "$ref": 5, }, - "node": Object { + "identifier": Object { + "name": "Dec", "range": Array [ - 0, - 29, + 42, + 45, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "Parameter", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "target", - "range": Array [ - 13, - 24, - ], - "type": "Identifier", + "$ref": 4, }, ], - "name": "target", - "references": Array [], - "scope": Object { + "type": "function", + "typeMap": Object {}, + "upperScope": 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, + "arguments": Object { + "$ref": 2, }, - "target": Object { - "$ref": 8, + "test": Object { + "$ref": 3, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 5, }, "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", - }, - ], + "$id": 2, + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - ], - "name": "target", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 5, }, }, Object { - "$id": 9, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "propertyKey", + "name": "test", "range": Array [ - 72, - 91, + 63, + 75, ], "type": "Identifier", }, "node": Object { "range": Array [ - 58, - 98, + 40, + 79, ], - "type": "ArrowFunctionExpression", + "type": "FunctionExpression", }, "parent": null, "type": "Parameter", @@ -4271,18 +4561,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "propertyKey", + "name": "test", "range": Array [ - 72, - 91, + 63, + 75, ], "type": "Identifier", }, ], - "name": "propertyKey", + "name": "test", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 5, }, }, ], @@ -4291,163 +4581,41 @@ Object { "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, + "$ref": 4, }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 18, + "$ref": 7, }, "variableMap": Object { - "C": Object { - "$ref": 12, + "Foo": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 18, + "$ref": 7, }, "variables": Array [ Object { - "$id": 12, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Foo", "range": Array [ - 113, - 114, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 15, + 81, ], "type": "ClassDeclaration", }, @@ -4458,18 +4626,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Foo", "range": Array [ - 113, - 114, + 21, + 24, ], "type": "Identifier", }, ], - "name": "C", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 6, }, }, ], @@ -4477,45 +4645,24 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": 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, + "$ref": 4, }, ], - "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 19, + "$ref": 8, }, "variableMap": Object { - "C": Object { - "$ref": 2, - }, - "dec": Object { + "Foo": Object { "$ref": 0, }, - "gec": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 18, + "$ref": 7, }, "variables": Array [ Object { @@ -4523,108 +4670,17 @@ Object { "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", + "name": "Foo", "range": Array [ - 113, - 114, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 15, + 81, ], "type": "ClassDeclaration", }, @@ -4635,18 +4691,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Foo", "range": Array [ - 113, - 114, + 21, + 24, ], "type": "Identifier", }, ], - "name": "C", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 18, + "$ref": 7, }, }, ], @@ -4655,512 +4711,285 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 19, + "$ref": 8, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` Object { - "$id": 15, + "$id": 8, "block": Object { "range": Array [ 0, - 71, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 14, + "$id": 7, "block": Object { "range": Array [ 0, - 71, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 13, + "$id": 6, "block": Object { "range": Array [ - 20, - 70, + 15, + 69, ], - "type": "TSEnumDeclaration", + "type": "ClassDeclaration", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": 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", + "$id": 5, + "block": Object { "range": Array [ - 37, - 38, + 40, + 67, ], - "type": "Identifier", + "type": "FunctionExpression", }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 13, + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "test": Object { + "$ref": 3, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 5, }, - "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, + "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": 7, - }, - Object { - "$ref": 9, + "$ref": 4, }, ], - "type": "enum", + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 14, + "$ref": 7, }, "variableMap": Object { - "A": Object { - "$ref": 3, - }, - "B": Object { - "$ref": 4, - }, - "C": Object { - "$ref": 5, + "Foo": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 7, }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "Foo", "range": Array [ - 33, - 34, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 33, - 38, + 15, + 69, ], - "type": "TSEnumMember", + "type": "ClassDeclaration", }, "parent": undefined, - "type": "EnumMemberName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "Foo", "range": Array [ - 33, - 34, + 21, + 24, ], "type": "Identifier", }, ], - "name": "A", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 11, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 6, }, }, - 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 [ + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "module", + "typeMap": Object {}, + "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": "E", + "name": "Foo", "range": Array [ - 25, - 26, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 70, + 15, + 69, ], - "type": "TSEnumDeclaration", + "type": "ClassDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "E", + "name": "Foo", "range": Array [ - 25, - 26, + 21, + 24, ], "type": "Identifier", }, ], - "name": "E", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 7, }, }, ], @@ -5169,871 +4998,964 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 8, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum-string.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorators.ts 1`] = ` Object { - "$id": 5, + "$id": 19, "block": Object { "range": Array [ 0, - 29, + 198, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 18, "block": Object { "range": Array [ 0, - 29, + 198, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 28, + 29, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, "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", - }, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "enum", + "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 18, }, "variableMap": Object { - "BAR": Object { - "$ref": 1, + "arguments": Object { + "$ref": 4, + }, + "target": Object { + "$ref": 5, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { - "$id": 1, + "$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": "BAR", + "name": "target", "range": Array [ - 15, - 18, + 13, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 26, + 0, + 29, ], - "type": "TSEnumMember", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumMemberName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "BAR", + "name": "target", "range": Array [ - 15, - 18, + 13, + 24, ], "type": "Identifier", }, ], - "name": "BAR", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "target", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], }, - ], - "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 [ + "$id": 11, + "block": Object { + "range": Array [ + 30, + 100, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "Foo", + "$id": 10, + "block": Object { "range": Array [ - 5, - 8, + 58, + 98, ], - "type": "Identifier", + "type": "ArrowFunctionExpression", }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSEnumDeclaration", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 5, - 8, + "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, + }, + }, ], - "type": "Identifier", }, ], - "name": "Foo", + "functionExpressionScope": false, + "isStrict": true, "references": Array [], - "scope": Object { - "$ref": 4, + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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 [], - "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, + "$id": 3, "from": Object { - "$ref": 1, + "$ref": 18, }, "identifier": Object { - "name": "a", + "name": "dec", "range": Array [ - 20, - 21, + 103, + 106, ], "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 19, + }, + "variableMap": Object { + "C": Object { + "$ref": 2, + }, + "dec": Object { + "$ref": 0, + }, + "gec": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 18, }, - "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 [ + "variables": Array [ Object { "$id": 0, - "from": Object { - "$ref": 1, + "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, }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", + }, + 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, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, }, - ], - "throughReferences": Array [ Object { - "$ref": 0, + "$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, + }, }, ], - "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, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 19, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/empty-body-function.ts 1`] = ` Object { - "$id": 15, + "$id": 10, "block": Object { "range": Array [ 0, - 67, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 14, + "$id": 9, "block": Object { "range": Array [ 0, - 67, + 70, ], "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, - }, + "childScopes": Array [ 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", + "block": Object { "range": Array [ - 43, - 44, + 0, + 69, ], - "type": "Identifier", + "type": "TSDeclareFunction", }, - "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 [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "a", + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", "range": Array [ - 6, - 7, + 36, + 39, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 6, - 7, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, }, - "parent": Object { + "identifier": Object { + "name": "Key", "range": Array [ - 0, - 22, + 40, + 43, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 7, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ Object { - "name": Object { - "name": "b", + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Value", "range": Array [ - 9, - 10, + 45, + 50, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": Object { + "$ref": 2, }, - "parent": Object { + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "subject", "range": Array [ - 0, - 22, + 61, + 68, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "$ref": 4, }, ], - "name": "b", - "references": Array [ - Object { - "$ref": 8, + "type": "empty-function", + "typeMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, }, - ], - "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, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "subject": Object { + "$ref": 3, }, - ], - "scope": Object { - "$ref": 14, }, - }, - Object { - "$id": 3, - "defs": Array [ + "variableScope": Object { + "$ref": 9, + }, + "variables": 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", + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Key", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 8, }, - "type": "Variable", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "d", - "range": Array [ - 15, - 16, + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, }, - ], - "name": "d", - "references": Array [ Object { - "$ref": 11, + "$id": 3, + "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": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, }, ], - "scope": Object { - "$ref": 14, - }, }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 4, + "$ref": 4, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "eachr": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "e", + "name": "eachr", "range": Array [ - 18, - 19, + 9, + 14, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 18, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 69, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "e", + "name": "eachr", "range": Array [ - 18, - 19, + 9, + 14, ], "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, - }, - ], + "name": "eachr", + "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 9, }, }, ], @@ -6044,404 +5966,371 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 6, - }, - Object { - "$ref": 10, + "$ref": 4, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 10, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum.ts 1`] = ` Object { - "$id": 8, + "$id": 15, "block": Object { "range": Array [ 0, - 101, + 71, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 14, "block": Object { "range": Array [ 0, - 101, + 71, ], "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, + "$id": 13, "block": Object { "range": Array [ - 19, - 46, + 20, + 70, ], - "type": "TSDeclareFunction", + "type": "TSEnumDeclaration", }, "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 [ + "references": 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 { + "$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": 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, + "$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": 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, + "$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", }, }, - ], - }, - ], - "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", + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "a", "range": Array [ - 56, - 57, + 48, + 49, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "C", "range": Array [ - 47, - 100, + 59, + 60, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "FunctionName", + "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, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "f", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", + "$ref": 7, + }, + Object { + "$ref": 9, }, ], - "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", + "type": "enum", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 14, }, "variableMap": Object { - "a": Object { - "$ref": 2, + "A": Object { + "$ref": 3, }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ + "B": Object { + "$ref": 4, + }, + "C": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "A", "range": Array [ - 30, - 39, + 33, + 34, ], "type": "Identifier", }, "node": Object { "range": Array [ - 19, - 46, + 33, + 38, ], - "type": "TSDeclareFunction", + "type": "TSEnumMember", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "EnumMemberName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "A", "range": Array [ - 30, - 39, + 33, + 34, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 11, + }, + ], "scope": Object { - "$ref": 3, + "$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, }, }, ], @@ -6449,19 +6338,49 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 15, }, "variableMap": Object { - "f": Object { + "E": Object { + "$ref": 1, + }, + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 14, }, "variables": Array [ Object { @@ -6469,214 +6388,188 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "a", "range": Array [ - 9, - 10, + 6, + 15, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 18, + 19, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "a", "range": Array [ - 9, - 10, + 6, + 15, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 14, }, }, - ], - }, - ], - "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", + 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", + "typeMap": Object {}, + "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": 6, + "$id": 3, "block": Object { "range": Array [ - 7, - 64, + 0, + 28, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 5, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "BAR", "range": Array [ - 35, - 62, + 15, + 18, ], - "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, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, + "kind": "w", + "resolved": Object { + "$ref": 1, }, - "variableScope": Object { - "$ref": 5, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "Literal", }, - "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", + "throughReferences": Array [], + "type": "enum", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object { - "Test": Object { + "BAR": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -6684,39 +6577,43 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Test", + "name": "BAR", "range": Array [ - 13, - 17, + 15, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 64, + 15, + 26, ], - "type": "ClassDeclaration", + "type": "TSEnumMember", }, "parent": undefined, - "type": "ClassName", + "type": "EnumMemberName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Test", + "name": "BAR", "range": Array [ - 13, - 17, + 15, + 18, ], "type": "Identifier", }, ], - "name": "Test", - "references": Array [], + "name": "BAR", + "references": Array [ + Object { + "$ref": 2, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], @@ -6725,22 +6622,19 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 5, }, "variableMap": Object { - "Test": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -6748,39 +6642,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Test", + "name": "Foo", "range": Array [ - 13, - 17, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 64, + 0, + 28, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "ClassName", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Test", + "name": "Foo", "range": Array [ - 13, - 17, + 5, + 8, ], "type": "Identifier", }, ], - "name": "Test", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], @@ -6789,28 +6683,25 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` Object { "$id": 2, "block": Object { "range": Array [ 0, - 115, + 23, ], "type": "Program", }, @@ -6820,82 +6711,59 @@ Object { "block": Object { "range": Array [ 0, - 115, + 23, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6905,13 +6773,13 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-as.ts 1`] = ` Object { "$id": 2, "block": Object { "range": Array [ 0, - 28, + 27, ], "type": "Program", }, @@ -6921,76 +6789,59 @@ Object { "block": Object { "range": Array [ 0, - 28, + 27, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7000,261 +6851,279 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` Object { - "$id": 1, + "$id": 17, "block": Object { "range": Array [ 0, - 16, + 67, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 16, "block": Object { "range": Array [ 0, - 16, + 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/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 [ + "references": Array [ Object { - "$id": 5, - "block": Object { + "$id": 6, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", "range": Array [ - 28, - 142, + 32, + 35, ], - "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, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, }, - "variableScope": Object { - "$ref": 5, + "identifier": Object { + "name": "foo", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 2, + "$id": 8, "from": Object { - "$ref": 6, + "$ref": 16, }, "identifier": Object { - "name": "text", + "name": "a", "range": Array [ - 6, - 10, + 37, + 38, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { "$ref": 0, }, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", "range": Array [ - 13, - 19, + 40, + 41, ], - "type": "Literal", + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, }, + "writeExpr": undefined, }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, + Object { + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, - "text": Object { - "$ref": 0, + Object { + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - }, - "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, + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "d", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 60, + 61, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 16, + }, + "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": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 17, + }, + "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": 16, + }, + "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, - 20, + 22, ], "type": "VariableDeclaration", }, @@ -7264,25 +7133,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "text", + "name": "a", "range": Array [ 6, - 10, + 7, ], "type": "Identifier", }, ], - "name": "text", + "name": "a", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 4, + "$ref": 8, }, ], "scope": Object { - "$ref": 6, + "$ref": 16, }, }, Object { @@ -7290,347 +7156,124 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "b", "range": Array [ - 37, - 40, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 28, - 142, + 9, + 10, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "FunctionName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "b", "range": Array [ - 37, - 40, + 9, + 10, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "b", + "references": Array [ + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 16, }, }, - ], - }, - ], - "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 [ + "$id": 2, + "defs": Array [ Object { - "$id": 8, - "block": Object { + "name": Object { + "name": "c", "range": Array [ - 73, - 121, + 12, + 13, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, + "node": Object { + "range": Array [ + 12, + 13, + ], + "type": "VariableDeclarator", }, - "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", + "parent": Object { "range": Array [ - 59, - 60, + 0, + 22, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "type": "VariableDeclaration", }, - "writeExpr": undefined, + "type": "Variable", }, ], - "throughReferences": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 5, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", }, ], - "type": "class", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ + "name": "c", + "references": 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, - }, + "$ref": 10, }, ], - }, - ], - "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", + "scope": Object { + "$ref": 16, }, }, 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", + "name": "d", "range": Array [ - 6, - 7, + 15, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 18, + 15, + 16, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 18, + 22, ], "type": "VariableDeclaration", }, @@ -7640,65 +7283,122 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s", + "name": "d", "range": Array [ - 6, - 7, + 15, + 16, ], "type": "Identifier", }, ], - "name": "s", + "name": "d", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 5, + "$ref": 13, }, ], "scope": Object { - "$ref": 10, + "$ref": 16, }, }, Object { - "$id": 1, + "$id": 4, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "e", "range": Array [ - 25, - 26, + 18, + 19, ], "type": "Identifier", }, "node": Object { "range": Array [ + 18, 19, - 123, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "e", "range": Array [ - 25, - 26, + 18, + 19, ], "type": "Identifier", }, ], - "name": "A", - "references": Array [], + "name": "e", + "references": Array [ + Object { + "$ref": 14, + }, + ], "scope": Object { - "$ref": 10, + "$ref": 16, + }, + }, + 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": 15, + }, + ], + "scope": Object { + "$ref": 16, }, }, ], @@ -7709,250 +7409,246 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 17, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/namespace.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload.ts 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, - 63, + 101, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, - 63, + 101, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 1, "block": Object { "range": Array [ - 24, - 56, + 0, + 18, ], - "type": "TSModuleBlock", + "type": "TSDeclareFunction", }, "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, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, }, "variableMap": Object { "a": Object { - "$ref": 5, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { - "$id": 5, + "$id": 2, "defs": Array [ Object { "name": Object { "name": "a", "range": Array [ - 43, - 44, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 43, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 37, - 48, + 19, + 46, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", "range": Array [ - 43, - 44, + 30, + 39, ], "type": "Identifier", }, ], "name": "a", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 3, }, }, ], }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "a", + "$id": 6, + "block": Object { "range": Array [ - 6, - 7, + 47, + 100, ], - "type": "Identifier", + "type": "FunctionDeclaration", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, }, - "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", + "variableMap": Object { + "a": Object { + "$ref": 5, + }, + "arguments": Object { + "$ref": 4, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "variableScope": Object { + "$ref": 6, }, - "writeExpr": undefined, + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object { - "N": Object { - "$ref": 1, - }, - "a": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -7960,96 +7656,39 @@ Object { "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", + "name": "f", "range": Array [ - 22, - 23, + 56, + 57, ], "type": "Identifier", }, "node": Object { "range": Array [ - 12, - 56, + 47, + 100, ], - "type": "TSModuleDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "NamespaceName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "N", + "name": "f", "range": Array [ - 22, - 23, + 56, + 57, ], "type": "Identifier", }, ], - "name": "N", - "references": Array [ - Object { - "$ref": 4, - }, - ], + "name": "f", + "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -8060,22 +7699,23 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/rest-element.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 35, + 47, ], "type": "Program", }, @@ -8085,87 +7725,99 @@ Object { "block": Object { "range": Array [ 0, - 35, + 47, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 34, + 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "empty-function", + "typeMap": Object {}, + "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", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "args": Object { + "a": Object { "$ref": 2, }, - "arguments": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "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", + "name": "a", "range": Array [ - 16, - 20, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 34, + 19, + 46, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "args", + "name": "a", "range": Array [ - 16, - 20, + 30, + 39, ], "type": "Identifier", }, ], - "name": "args", + "name": "a", "references": Array [], "scope": Object { "$ref": 3, @@ -8179,11 +7831,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "foo": Object { + "f": Object { "$ref": 0, }, }, @@ -8196,19 +7849,19 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "f", "range": Array [ 9, - 12, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 34, + 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "FunctionName", @@ -8217,15 +7870,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "f", "range": Array [ 9, - 12, + 10, ], "type": "Identifier", }, ], - "name": "foo", + "name": "f", "references": Array [], "scope": Object { "$ref": 4, @@ -8239,6 +7892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8248,63 +7902,13 @@ Object { } `; -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`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` Object { "$id": 8, "block": Object { "range": Array [ 0, - 103, + 65, ], "type": "Program", }, @@ -8314,7 +7918,7 @@ Object { "block": Object { "range": Array [ 0, - 103, + 65, ], "type": "Program", }, @@ -8323,8 +7927,8 @@ Object { "$id": 6, "block": Object { "range": Array [ - 32, - 102, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -8333,25 +7937,48 @@ Object { "$id": 5, "block": Object { "range": Array [ - 47, - 100, + 35, + 62, ], "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "a": Object { - "$ref": 4, - }, "arguments": Object { + "$ref": 2, + }, + "config": Object { "$ref": 3, }, }, @@ -8360,7 +7987,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], @@ -8371,21 +7998,21 @@ Object { }, }, Object { - "$id": 4, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "config", "range": Array [ - 48, - 59, + 47, + 53, ], "type": "Identifier", }, "node": Object { "range": Array [ - 47, - 100, + 35, + 62, ], "type": "FunctionExpression", }, @@ -8396,15 +8023,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "config", "range": Array [ - 48, - 59, + 47, + 53, ], "type": "Identifier", }, ], - "name": "a", + "name": "config", "references": Array [], "scope": Object { "$ref": 5, @@ -8416,14 +8043,19 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "C": Object { - "$ref": 2, + "Test": Object { + "$ref": 1, }, }, "variableScope": Object { @@ -8431,21 +8063,21 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Test", "range": Array [ - 38, - 39, + 13, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 102, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -8456,15 +8088,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Test", "range": Array [ - 38, - 39, + 13, + 17, ], "type": "Identifier", }, ], - "name": "C", + "name": "Test", "references": Array [], "scope": Object { "$ref": 6, @@ -8476,16 +8108,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "C": Object { - "$ref": 1, - }, - "a": Object { + "Test": Object { "$ref": 0, }, }, @@ -8498,82 +8132,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "Test", "range": Array [ - 20, - 31, + 13, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 31, + 7, + 64, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "Test", "range": Array [ - 20, - 31, + 13, + 17, ], "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", + "name": "Test", "references": Array [], "scope": Object { "$ref": 7, @@ -8585,8 +8173,13 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8596,240 +8189,265 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 5, + "$id": 14, "block": Object { "range": Array [ 0, - 40, + 115, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 13, "block": Object { "range": Array [ 0, - 40, + 115, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", + "$id": 5, + "block": Object { "range": Array [ - 17, - 18, + 0, + 15, ], - "type": "Identifier", + "type": "TSTypeAliasDeclaration", }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "TSTypeAssertion", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, }, + "variables": Array [], }, Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", + "$id": 7, + "block": Object { "range": Array [ - 25, - 26, + 16, + 44, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], }, Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", + "$id": 12, + "block": Object { "range": Array [ - 28, - 29, + 45, + 104, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 32, - 38, - ], - "type": "TSAsExpression", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 65, + 66, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 80, + 91, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 88, + 89, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 99, + 100, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 13, }, "identifier": Object { - "name": "b", + "name": "C", "range": Array [ - 32, - 33, + 113, + 114, ], "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { + "$ref": 9, + }, + ], + "type": "module", + "typeMap": Object { + "A": Object { "$ref": 0, }, - Object { + "B": Object { "$ref": 1, }, - Object { + "C": 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, + "$ref": 14, }, "variableMap": Object { - "f": Object { - "$ref": 0, + "a": Object { + "$ref": 3, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 13, }, "variables": Array [ Object { @@ -8837,170 +8455,183 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "A", "range": Array [ - 9, - 10, + 5, + 6, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 18, + 15, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "A", "range": Array [ - 9, - 10, + 5, + 6, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 13, }, }, - ], - }, - ], - "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", + "name": "B", "range": Array [ - 6, - 7, + 26, + 27, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 37, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 38, + 16, + 44, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "B", "range": Array [ - 6, - 7, + 26, + 27, ], "type": "Identifier", }, ], - "name": "a", + "name": "B", "references": Array [ Object { - "$ref": 1, + "$ref": 8, }, ], "scope": Object { - "$ref": 2, + "$ref": 13, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 45, + 104, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 3, + "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": 13, }, }, ], @@ -9009,98 +8640,59 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 9, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 14, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 43, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 43, + 28, ], "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, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 2, }, "variableMap": Object { - "obj": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [ Object { @@ -9108,52 +8700,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, 7, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 27, ], - "type": "VariableDeclaration", + "type": "TSImportEqualsDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, 7, + 10, ], "type": "Identifier", }, ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "name": "foo", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 1, }, }, ], @@ -9164,303 +8743,75 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` Object { - "$id": 9, + "$id": 1, "block": Object { "range": Array [ 0, - 63, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 0, "block": Object { "range": Array [ 0, - 63, + 16, ], "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, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 0, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 1, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/interface-type.ts 1`] = ` Object { "$id": 9, "block": Object { "range": Array [ 0, - 165, + 67, ], "type": "Program", }, @@ -9470,164 +8821,215 @@ Object { "block": Object { "range": Array [ 0, - 165, + 67, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", + "$id": 3, + "block": Object { "range": Array [ - 6, - 9, + 0, + 25, ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "type": "TSInterfaceDeclaration", }, - "writeExpr": Object { - "range": Array [ - 12, - 24, - ], - "type": "ObjectExpression", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, }, - }, - Object { - "$id": 2, - "from": Object { + "upperScope": Object { "$ref": 8, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, }, - "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, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 11, + 20, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", + "$id": 7, + "block": Object { "range": Array [ - 125, - 128, + 27, + 66, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 63, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 4, + }, }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { + "upperScope": 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 { + "variableMap": Object {}, + "variableScope": Object { "$ref": 8, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 159, - 162, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 38, + 51, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "obj": Object { + "typeMap": Object { + "C": Object { "$ref": 0, }, + "R": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 9, }, + "variableMap": Object {}, "variableScope": Object { "$ref": 8, }, @@ -9637,65 +9039,84 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "C", "range": Array [ - 6, - 9, + 10, + 11, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 24, + 25, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "C", "range": Array [ - 6, - 9, + 10, + 11, ], "type": "Identifier", }, ], - "name": "obj", + "name": "C", "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, Object { "$ref": 5, }, Object { "$ref": 6, }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { - "$ref": 7, + "name": Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 66, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", }, ], + "name": "R", + "references": Array [], "scope": Object { "$ref": 8, }, @@ -9708,6 +9129,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9717,33 +9139,33 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-return-type.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, - 83, + 143, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, - 83, + 143, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ - 0, - 82, + 28, + 142, ], "type": "FunctionDeclaration", }, @@ -9752,95 +9174,53 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { - "name": "a", + "name": "text", "range": Array [ - 30, - 31, + 116, + 120, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 0, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { - "a": Object { - "$ref": 2, - }, "arguments": Object { - "$ref": 1, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "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, + "$ref": 5, }, }, ], @@ -9848,19 +9228,49 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "f": Object { + "Foo": Object { + "$ref": 1, + }, + "text": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -9868,17 +9278,70 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "text", "range": Array [ - 9, + 6, 10, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 82, + 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", }, @@ -9889,18 +9352,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "Foo", "range": Array [ - 9, - 10, + 37, + 40, ], "type": "Identifier", }, ], - "name": "f", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -9911,139 +9374,232 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/method-overload.ts 1`] = ` Object { - "$id": 6, + "$id": 12, "block": Object { "range": Array [ 0, - 62, + 124, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 11, "block": Object { "range": Array [ 0, - 62, + 124, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 10, "block": Object { "range": Array [ - 0, - 61, + 19, + 123, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 73, + 121, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "a": Object { + "$ref": 8, + }, + "arguments": Object { + "$ref": 7, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 8, + "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": 9, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 10, }, "identifier": Object { - "name": "g", + "name": "a", "range": Array [ - 28, - 29, + 49, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 59, + 60, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 0, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "function", + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 11, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "g": Object { - "$ref": 2, + "A": Object { + "$ref": 4, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 11, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, + "$id": 4, "defs": Array [ Object { "name": Object { - "name": "g", + "name": "A", "range": Array [ - 31, - 35, + 25, + 26, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 61, + 19, + 123, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "g", + "name": "A", "range": Array [ - 31, - 35, + 25, + 26, ], "type": "Identifier", }, ], - "name": "g", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "name": "A", + "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 10, }, }, ], @@ -10051,19 +9607,73 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 11, + }, + "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": 11, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 12, }, "variableMap": Object { - "g": Object { + "A": Object { + "$ref": 1, + }, + "s": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 11, }, "variables": Array [ Object { @@ -10071,39 +9681,92 @@ Object { "defs": Array [ Object { "name": Object { - "name": "g", + "name": "s", "range": Array [ - 9, - 10, + 6, + 7, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 18, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 61, + 18, ], - "type": "FunctionDeclaration", + "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": 6, + }, + ], + "scope": Object { + "$ref": 11, + }, + }, + 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": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "g", + "name": "A", "range": Array [ - 9, - 10, + 25, + 26, ], "type": "Identifier", }, ], - "name": "g", + "name": "A", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 11, }, }, ], @@ -10112,34 +9775,42 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 12, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/mixed-variable-ref.ts 1`] = ` Object { - "$id": 12, + "$id": 5, "block": Object { "range": Array [ 0, - 147, + 32, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 4, "block": Object { "range": Array [ 0, - 147, + 32, ], "type": "Program", }, @@ -10148,15 +9819,15 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 11, + "$ref": 4, }, "identifier": Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, - 7, + 6, + 9, ], "type": "Identifier", }, @@ -10166,166 +9837,67 @@ Object { }, "writeExpr": Object { "range": Array [ - 10, - 22, + 12, + 13, ], - "type": "ObjectExpression", + "type": "Literal", }, }, Object { - "$id": 5, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 4, }, "identifier": Object { - "name": "obj2", + "name": "foo", "range": Array [ + 24, 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, - }, + "resolved": null, "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, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 4, }, "identifier": Object { - "name": "obj", + "name": "test", "range": Array [ - 81, - 84, + 19, + 23, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ 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", - }, + "$ref": 2, }, 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, + "$ref": 3, }, ], - "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 5, }, "variableMap": Object { - "element": Object { - "$ref": 3, - }, - "obj": Object { + "foo": Object { "$ref": 0, }, - "obj2": Object { - "$ref": 1, - }, - "value": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 11, + "$ref": 4, }, "variables": Array [ Object { @@ -10333,24 +9905,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, - 7, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 22, + 6, + 13, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, + 14, ], "type": "VariableDeclaration", }, @@ -10360,181 +9932,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "foo", "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, + 6, + 9, ], "type": "Identifier", }, ], - "name": "element", + "name": "foo", "references": Array [ Object { - "$ref": 9, + "$ref": 1, }, ], "scope": Object { - "$ref": 11, + "$ref": 4, }, }, ], @@ -10543,204 +9956,258 @@ Object { "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 [ + "throughReferences": 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 [], + "$ref": 2, + }, + Object { + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/namespace.ts 1`] = ` Object { - "$id": 2, + "$id": 10, "block": Object { "range": Array [ 0, - 49, + 63, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ 0, - 49, + 63, ], "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 [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", + "$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 [ - 4, - 47, + 43, + 44, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { "range": Array [ - 4, 47, + 48, ], - "type": "VariableDeclarator", + "type": "Literal", }, - "parent": Object { + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", "range": Array [ - 0, - 48, + 53, + 54, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "a": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ Object { - "name": "x", - "range": Array [ - 4, - 47, + "$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", + }, ], - "type": "Identifier", + "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, + }, }, ], - "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 [], + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 10, }, "variableMap": Object { - "x": Object { + "N": Object { + "$ref": 1, + }, + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 9, }, "variables": Array [ Object { @@ -10748,24 +10215,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "a", "range": Array [ - 4, - 45, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 45, + 6, + 11, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 46, + 11, ], "type": "VariableDeclaration", }, @@ -10775,18 +10242,69 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "a", "range": Array [ - 4, - 45, + 6, + 7, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "scope": Object { - "$ref": 1, + "$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, }, }, ], @@ -10797,51 +10315,138 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/rest-element.ts 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 13, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 13, + 35, ], "type": "Program", }, - "childScopes": Array [], + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "x": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -10849,45 +10454,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "foo", "range": Array [ - 4, - 11, + 9, + 12, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 12, + 34, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "foo", "range": Array [ - 4, - 11, + 9, + 12, ], "type": "Identifier", }, ], - "name": "x", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -10898,151 +10497,79 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-infer.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 147, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 147, + 18, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "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, + "$ref": 2, }, "variables": Array [ Object { @@ -11050,45 +10577,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "map", + "name": "foo", "range": Array [ - 4, - 35, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 36, + 17, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "foo", "range": Array [ - 4, - 35, + 5, + 8, ], "type": "Identifier", }, ], - "name": "map", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -11099,152 +10620,314 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` Object { - "$id": 2, + "$id": 13, "block": Object { "range": Array [ 0, - 47, + 103, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 12, "block": Object { "range": Array [ 0, - 47, + 103, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 11, + "block": Object { + "range": Array [ + 32, + 102, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", - }, - "parent": Object { + "$id": 10, + "block": Object { "range": Array [ - 0, - 46, + 47, + 100, ], - "type": "VariableDeclaration", + "type": "FunctionExpression", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 45, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, ], - "type": "Identifier", - }, - ], - "name": "map", - "references": Array [], - "scope": Object { - "$ref": 1, + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "a": Object { + "$ref": 7, + }, + "arguments": Object { + "$ref": 6, + }, + }, + "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": "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": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "C": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 12, }, + "variables": Array [ + Object { + "$id": 5, + "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": 11, + }, + }, + ], }, ], - }, - ], - "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 [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 2, + "$ref": 13, }, "variableMap": Object { - "map": Object { - "$ref": 0, + "C": Object { + "$ref": 2, + }, + "a": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 12, }, "variables": Array [ Object { @@ -11252,125 +10935,74 @@ Object { "defs": Array [ Object { "name": Object { - "name": "map", + "name": "A", "range": Array [ - 4, - 46, + 5, + 6, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 46, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 47, + 15, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "A", "range": Array [ - 4, - 46, + 5, + 6, ], "type": "Identifier", }, ], - "name": "map", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 12, }, }, - ], - }, - ], - "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, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "map", + "name": "a", "range": Array [ - 4, - 47, + 20, + 31, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 47, + 20, + 31, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 0, - 48, + 16, + 31, ], "type": "VariableDeclaration", }, @@ -11380,18 +11012,58 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "a", "range": Array [ - 4, - 47, + 20, + 31, ], "type": "Identifier", }, ], - "name": "map", + "name": "a", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 12, + }, + }, + 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": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 12, }, }, ], @@ -11402,151 +11074,211 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "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, + "$ref": 13, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ 0, - 29, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 8, "block": Object { "range": Array [ 0, - 29, + 40, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": 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 [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "TSTypeAssertion", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 32, + 38, + ], + "type": "TSAsExpression", + }, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "A": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [ Object { @@ -11554,45 +11286,46 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "A", "range": Array [ - 4, - 8, + 5, + 6, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 8, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 9, + 16, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "A", "range": Array [ - 4, - 8, + 5, + 6, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 6, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 8, }, }, ], @@ -11601,154 +11334,154 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 9, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 22, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 22, + 19, ], "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 [ + "childScopes": 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", + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, + "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, }, - "type": "Variable", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "x", - "range": Array [ - 4, - 20, + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 13, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], - "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "x": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -11756,45 +11489,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "f", "range": Array [ - 4, - 27, + 9, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 28, + 18, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "f", "range": Array [ - 4, - 27, + 9, + 10, ], "type": "Identifier", }, ], - "name": "x", + "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -11805,51 +11532,100 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 33, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 33, + 39, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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, + 37, + ], + "type": "JSXElement", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "TypeA", + "range": Array [ + 28, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { - "x": Object { + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -11857,24 +11633,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "a", "range": Array [ - 4, - 31, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 31, + 6, + 37, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 32, + 38, ], "type": "VariableDeclaration", }, @@ -11884,18 +11660,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "a", "range": Array [ - 4, - 31, + 6, + 7, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -11904,53 +11684,127 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-empty.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typed-this.src.ts 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 11, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 11, + 31, ], "type": "Program", }, - "childScopes": Array [], + "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": "String", + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "function", + "typeMap": Object {}, + "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 [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "x": Object { + "test": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -11958,45 +11812,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "test", "range": Array [ - 4, 9, + 13, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 10, + 30, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "test", "range": Array [ - 4, 9, + 13, ], "type": "Identifier", }, ], - "name": "x", + "name": "test", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -12005,53 +11853,139 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-optional.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof.ts 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, - 45, + 43, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 45, + 43, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 23, + 42, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 22, + ], + "type": "ObjectExpression", + }, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "B": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { - "x": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -12059,24 +11993,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "obj", "range": Array [ 4, - 44, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 44, + 22, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 44, + 22, ], "type": "VariableDeclaration", }, @@ -12086,73 +12020,279 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "obj", "range": Array [ 4, - 44, + 7, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 5, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 23, + 42, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-rest.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` Object { - "$id": 2, + "$id": 9, "block": Object { "range": Array [ 0, - 29, + 63, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, - 29, + 63, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 9, }, "variableMap": Object { - "x": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [ Object { @@ -12160,24 +12300,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "obj", "range": Array [ 4, - 28, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 28, + 22, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 28, + 22, ], "type": "VariableDeclaration", }, @@ -12187,18 +12327,28 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "obj", "range": Array [ 4, - 28, + 7, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 8, }, }, ], @@ -12207,490 +12357,468 @@ Object { "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 [ + "throughReferences": 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 [], + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 9, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-literal.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` Object { - "$id": 2, + "$id": 18, "block": Object { "range": Array [ 0, - 24, + 165, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 17, "block": Object { "range": Array [ 0, - 24, + 165, ], "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 [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 16, + "block": Object { + "range": Array [ + 25, + 164, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { + "$id": 4, + "from": Object { + "$ref": 16, + }, + "identifier": Object { "name": "obj", "range": Array [ - 4, - 22, + 61, + 64, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": Object { + "$ref": 0, }, - "parent": Object { + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", "range": Array [ - 0, - 23, + 66, + 79, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 22, - ], - "type": "Identifier", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "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", + "$id": 6, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 4, - 14, + 76, + 79, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": Object { + "$ref": 0, }, - "parent": Object { + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", "range": Array [ - 0, - 15, + 81, + 85, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", + "$id": 8, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 84, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ Object { - "name": Object { - "name": "y", + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 20, - 36, + 95, + 98, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 20, - 36, + 125, + 128, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", "range": Array [ - 16, - 37, + 130, + 143, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "type": "Identifier", + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 140, + 143, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, - ], - "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", + "$id": 13, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", "range": Array [ - 4, - 17, + 145, + 149, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "T", "range": Array [ - 4, - 17, + 148, + 149, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 0, - 18, + 159, + 162, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "x", - "range": Array [ - 4, - 17, - ], - "type": "Identifier", + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 15, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 17, }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 65, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "T", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 107, + 129, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$ref": 16, + }, + }, + ], }, ], - }, - ], - "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 [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 24, + ], + "type": "ObjectExpression", + }, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 5, + "$ref": 18, }, "variableMap": Object { - "intersection": Object { - "$ref": 1, - }, - "precedence1": Object { - "$ref": 2, - }, - "precedence2": Object { - "$ref": 3, - }, - "union": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 17, }, "variables": Array [ Object { @@ -12698,24 +12826,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "union", + "name": "obj", "range": Array [ - 4, - 36, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 36, + 6, + 24, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 37, + 24, ], "type": "VariableDeclaration", }, @@ -12725,18 +12853,40 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "union", + "name": "obj", "range": Array [ - 4, - 36, + 6, + 9, ], "type": "Identifier", }, ], - "name": "union", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 15, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 17, }, }, Object { @@ -12744,137 +12894,258 @@ Object { "defs": Array [ Object { "name": Object { - "name": "intersection", + "name": "A", "range": Array [ - 42, - 71, + 35, + 36, ], "type": "Identifier", }, "node": Object { "range": Array [ - 42, - 71, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 38, - 72, + 25, + 164, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "intersection", + "name": "A", "range": Array [ - 42, - 71, + 35, + 36, ], "type": "Identifier", }, ], - "name": "intersection", + "name": "A", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 17, }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 18, + }, + "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": 2, - "defs": Array [ + "$id": 4, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "precedence1", - "range": Array [ - 77, - 115, - ], - "type": "Identifier", + "$id": 3, + "from": Object { + "$ref": 4, }, - "node": Object { + "identifier": Object { + "name": "a", "range": Array [ - 77, - 115, + 30, + 31, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { - "range": Array [ - 73, - 116, - ], - "type": "VariableDeclaration", + "kind": "r", + "resolved": Object { + "$ref": 2, }, - "type": "Variable", + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ Object { - "name": "precedence1", - "range": Array [ - 77, - 115, + "$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", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 11, + 20, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, }, ], - "name": "precedence1", - "references": Array [], - "scope": Object { - "$ref": 4, - }, }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ Object { - "$id": 3, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "precedence2", + "name": "f", "range": Array [ - 121, - 159, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 121, - 159, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 117, - 160, + 0, + 82, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "precedence2", + "name": "f", "range": Array [ - 121, - 159, + 9, + 10, ], "type": "Identifier", }, ], - "name": "precedence2", + "name": "f", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -12885,49 +13156,272 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, - 27, + 62, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 7, "block": Object { "range": Array [ 0, - 27, + 62, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 61, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "g", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "g": 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": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 30, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 3, + "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": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 1, + "$ref": 8, + }, + "variableMap": Object { + "g": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 7, }, - "variables": Array [], + "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": 7, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -12935,200 +13429,456 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/535.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` Object { - "$id": 5, + "$id": 12, "block": Object { "range": Array [ 0, - 52, + 147, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 11, "block": Object { "range": Array [ 0, - 51, + 147, ], - "type": "FunctionDeclaration", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 11, }, "identifier": Object { - "name": "bar", + "name": "obj", "range": Array [ - 45, - 48, + 4, + 7, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 0, }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 12, }, "variableMap": Object { - "arguments": Object { + "element": Object { + "$ref": 3, + }, + "obj": Object { + "$ref": 0, + }, + "obj2": Object { "$ref": 1, }, - "bar": Object { + "value": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 11, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], + "$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 [], - "name": "arguments", - "references": Array [], + "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": 4, + "$ref": 11, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "obj2", "range": Array [ - 15, - 18, + 27, + 43, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 51, + 27, + 58, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "Parameter", + "parent": Object { + "range": Array [ + 23, + 58, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", + "name": "obj2", "range": Array [ - 15, - 18, + 27, + 43, ], "type": "Identifier", }, ], - "name": "bar", + "name": "obj2", "references": Array [ Object { - "$ref": 3, + "$ref": 5, }, ], "scope": Object { - "$ref": 4, + "$ref": 11, }, }, - ], - }, - ], - "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", + "$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, }, - "parent": null, - "type": "FunctionName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "foo", - "range": Array [ - 9, - 12, + "$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", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + ], + "name": "element", + "references": Array [ + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 11, + }, }, ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/abstract-class.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 69, + 20, ], "type": "Program", }, @@ -13138,63 +13888,90 @@ Object { "block": Object { "range": Array [ 0, - 68, + 20, ], - "type": "ClassDeclaration", + "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { "$ref": 3, }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "Foo", "range": Array [ - 15, - 16, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 68, + 19, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "Foo", "range": Array [ - 15, - 16, + 5, + 8, ], "type": "Identifier", }, ], - "name": "A", + "name": "Foo", "references": Array [], "scope": Object { "$ref": 2, @@ -13208,136 +13985,202 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, - "variables": Array [ + "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": 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", + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "name": "A", - "range": Array [ - 15, - 16, + "$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", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, }, ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 3, - }, }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-implements.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 83, + 47, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, - 82, + 47, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "x": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "x", "range": Array [ - 6, - 9, + 4, + 45, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 82, + 46, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": undefined, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "x", "range": Array [ - 6, - 9, + 4, + 45, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 1, }, }, ], @@ -13348,182 +14191,141 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "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, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-properties.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` Object { - "$id": 8, + "$id": 4, "block": Object { "range": Array [ 0, - 63, + 13, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ - 19, - 62, + 0, + 13, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 1, "from": Object { - "$ref": 7, + "$ref": 3, }, "identifier": Object { - "name": "s", + "name": "K", "range": Array [ - 43, - 44, + 9, + 10, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 2, "from": Object { - "$ref": 7, + "$ref": 3, }, "identifier": Object { - "name": "s", + "name": "T", "range": Array [ - 50, - 51, + 7, + 8, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 1, }, Object { - "$ref": 6, + "$ref": 2, }, ], - "type": "class", + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 4, }, "variableMap": Object { - "A": Object { - "$ref": 4, - }, + "x": Object { + "$ref": 0, + }, }, "variableScope": Object { - "$ref": 8, + "$ref": 3, }, "variables": Array [ Object { - "$id": 4, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "x", "range": Array [ - 25, - 26, + 4, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ - 19, - 62, + 4, + 11, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "x", "range": Array [ - 25, - 26, + 4, + 11, ], "type": "Identifier", }, ], - "name": "A", + "name": "x", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 3, }, }, ], @@ -13531,443 +14333,435 @@ Object { ], "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", - }, - }, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 10, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "$ref": 1, }, - ], - "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 2, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, - "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, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-supper-type.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-infer.ts 1`] = ` Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 0, - 117, + 147, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 14, "block": Object { "range": Array [ 0, - 40, + 147, ], - "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, + "type": "Program", }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 6, - "defs": Array [ + "$id": 13, + "block": Object { + "range": Array [ + 0, + 146, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "Foo", + "$id": 2, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 15, - 18, + 23, + 24, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 0, - 40, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 40, + 41, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", + "$id": 4, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "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", + "$id": 5, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 56, + 59, 60, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 42, - 82, + 75, + 76, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 79, + 80, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "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", + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 90, - 94, + 95, + 96, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "Promise", "range": Array [ - 84, - 116, + 105, + 112, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 119, + 120, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "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", + Object { + "$id": 11, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 124, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 144, + 145, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "module", + "typeMap": Object { + "Unpacked": Object { + "$ref": 0, + }, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 12, + "upperScope": Object { + "$ref": 15, }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Unpacked", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 146, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Unpacked", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Unpacked", + "references": Array [], + "scope": Object { + "$ref": 14, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], "throughReferences": Array [ Object { "$ref": 3, @@ -13976,764 +14770,378 @@ Object { "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, + Object { + "$ref": 7, }, - "Foo2": Object { - "$ref": 1, + Object { + "$ref": 9, }, - "Foo3": Object { - "$ref": 2, + Object { + "$ref": 10, }, - }, + Object { + "$ref": 11, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, - "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, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 110, + 50, ], "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, - }, + "childScopes": Array [ 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", + "block": Object { "range": Array [ - 71, - 73, + 0, + 50, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "type": "Program", }, - "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 [ + "childScopes": Array [ Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { + "$id": 5, + "block": Object { "range": Array [ 0, - 34, + 49, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s1", - "range": Array [ - 6, - 8, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "LinkedList", + "range": Array [ + 33, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, ], - "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", + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, }, - "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", + "upperScope": Object { + "$ref": 6, }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s2", - "range": Array [ - 21, - 23, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, ], - "type": "Identifier", }, ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "LinkedList": Object { + "$ref": 0, }, - ], - "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, + "upperScope": Object { + "$ref": 7, }, - "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, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + ], + "name": "LinkedList", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, - "variables": Array [ + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 2, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", + "$id": 1, + "from": Object { + "$ref": 2, }, - "parent": Object { + "identifier": Object { + "name": "P", "range": Array [ - 0, - 34, + 12, + 13, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", + "$ref": 1, }, ], - "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, + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "map": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { - "$id": 2, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "map", "range": Array [ - 19, - 28, + 4, + 35, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 35, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 37, + 36, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, - "parent": null, - "type": "Parameter", + "type": "Variable", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "map", "range": Array [ - 19, - 28, + 4, + 35, ], "type": "Identifier", }, ], - "name": "a", + "name": "map", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -14741,187 +15149,128 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "references": Array [ + "references": Array [], + "throughReferences": 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, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, - "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, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 70, + 47, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 69, + 47, ], - "type": "TSDeclareFunction", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { - "name": "subject", + "name": "P", "range": Array [ - 61, - 68, + 21, + 22, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "empty-function", + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "subject": Object { - "$ref": 1, + "map": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "subject", + "name": "map", "range": Array [ - 27, - 51, + 4, + 45, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 69, + 46, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, - "parent": null, - "type": "Parameter", + "type": "Variable", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "subject", + "name": "map", "range": Array [ - 27, - 51, + 4, + 45, ], "type": "Identifier", }, ], - "name": "subject", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "map", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -14930,252 +15279,106 @@ Object { "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 [ + "throughReferences": 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", - }, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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": 2, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-module.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 95, + 48, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ - 33, - 92, + 0, + 48, ], - "type": "TSModuleBlock", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 2, }, "identifier": Object { - "name": "a", + "name": "P", "range": Array [ - 89, - 90, + 22, + 23, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "block", + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 3, }, "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "b": Object { - "$ref": 4, + "map": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 2, }, "variables": Array [ Object { - "$id": 3, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "map", "range": Array [ - 52, - 61, + 4, + 46, ], "type": "Identifier", }, "node": Object { "range": Array [ - 52, - 61, + 4, + 46, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 46, - 61, + 0, + 47, ], "type": "VariableDeclaration", }, @@ -15185,47 +15388,126 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "map", "range": Array [ - 52, - 61, + 4, + 46, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - ], + "name": "map", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-plus.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 4, + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "map": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "b", + "name": "map", "range": Array [ - 79, - 90, + 4, + 47, ], "type": "Identifier", }, "node": Object { "range": Array [ - 79, - 90, + 4, + 47, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 73, - 90, + 0, + 48, ], "type": "VariableDeclaration", }, @@ -15235,18 +15517,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "b", + "name": "map", "range": Array [ - 79, - 90, + 4, + 47, ], "type": "Identifier", }, ], - "name": "b", + "name": "map", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, }, }, ], @@ -15254,247 +15536,109 @@ Object { ], "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", - }, - }, + "references": Array [], + "throughReferences": Array [ 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, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$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, - 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, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 65, + 81, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ - 15, - 64, + 0, + 81, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ - 40, - 62, + 0, + 80, ], - "type": "FunctionExpression", + "type": "TSTypeAliasDeclaration", }, "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", + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "throughReferences": Array [], + "type": "module", + "typeMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { "name": "Foo", "range": Array [ - 21, - 24, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 0, + 80, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -15502,8 +15646,8 @@ Object { Object { "name": "Foo", "range": Array [ - 21, - 24, + 5, + 8, ], "type": "Identifier", }, @@ -15511,7 +15655,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -15520,252 +15664,246 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, - "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, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 65, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ - 15, - 64, + 0, + 29, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ - 40, - 62, + 0, + 28, ], - "type": "FunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", + "name": Object { + "name": "Foo", "range": Array [ - 42, - 45, + 5, + 8, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", }, ], - "throughReferences": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 4, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", }, ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, }, - "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": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference.src.ts 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 [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], - "type": "class", + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 3, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "x": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "x", "range": Array [ - 21, - 24, + 4, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 4, + 8, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 9, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "x", "range": Array [ - 21, - 24, + 4, + 8, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "x", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, }, }, ], @@ -15776,18 +15914,8009 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic.src.ts 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": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, + "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, + 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": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic-nested.src.ts 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 [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 13, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "typeMap": Object {}, + "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, + 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": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": 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": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "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": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": 4, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + "y": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "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": 3, + }, + }, + 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": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": 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 [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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": 8, + "block": Object { + "range": Array [ + 0, + 83, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Component", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Nullable", + "range": Array [ + 41, + 49, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "SomeOther", + "range": Array [ + 50, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Component2", + "range": Array [ + 67, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "class", + "typeMap": Object { + "Nullable": Object { + "$ref": 2, + }, + }, + "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, + 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": 7, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Nullable", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "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, + 82, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], +} +`; + +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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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": true, + "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": 15, + "block": Object { + "range": Array [ + 0, + 117, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "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": 8, + }, + }, + ], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 42, + 82, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 10, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo2": Object { + "$ref": 9, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 9, + "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": 11, + }, + }, + ], + }, + Object { + "$id": 14, + "block": Object { + "range": Array [ + 84, + 116, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 107, + 110, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo3": Object { + "$ref": 12, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 12, + "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": 14, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 69, + 72, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 13, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + "Foo2": Object { + "$ref": 1, + }, + "Foo3": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "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": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 15, + }, + }, + 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": true, + "identifiers": Array [ + Object { + "name": "Foo2", + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + }, + ], + "name": "Foo2", + "references": Array [], + "scope": Object { + "$ref": 15, + }, + }, + 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": true, + "identifiers": Array [ + Object { + "name": "Foo3", + "range": Array [ + 90, + 94, + ], + "type": "Identifier", + }, + ], + "name": "Foo3", + "references": Array [], + "scope": Object { + "$ref": 15, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-with-type-extends-default.ts 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 7, + 38, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "Bar": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 38, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Bar", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 35, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Bar": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 38, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Bar", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` +Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 110, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 11, + "block": Object { + "range": Array [ + 35, + 109, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 54, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 71, + 73, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 75, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 87, + 97, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "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": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "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": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + ], + "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, + "upperScope": null, + "variableMap": Object { + "s1": Object { + "$ref": 0, + }, + "s2": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "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": true, + "identifiers": Array [ + Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + ], + "name": "s1", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + 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": true, + "identifiers": Array [ + Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + ], + "name": "s2", + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 109, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` +Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 107, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 11, + "block": Object { + "range": Array [ + 35, + 106, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 51, + 53, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 68, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 72, + 82, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 84, + 94, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "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": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "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": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + ], + "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, + "upperScope": null, + "variableMap": Object { + "s1": Object { + "$ref": 0, + }, + "s2": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "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": true, + "identifiers": Array [ + Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + ], + "name": "s1", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + 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": true, + "identifiers": Array [ + Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + ], + "name": "s2", + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 106, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + ], +} +`; + +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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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": 9, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Key", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Value", + "range": Array [ + 45, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "subject", + "range": Array [ + 61, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "empty-function", + "typeMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "subject": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Key", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 3, + "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": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "eachr": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "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": true, + "identifiers": Array [ + Object { + "name": "eachr", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + ], + "name": "eachr", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], +} +`; + +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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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": true, + "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": true, + "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/empty-body-function.ts 1`] = ` +Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Key", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Value", + "range": Array [ + 45, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "subject", + "range": Array [ + 61, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "empty-function", + "typeMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "subject": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Key", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 3, + "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": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "eachr": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "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": true, + "identifiers": Array [ + Object { + "name": "eachr", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + ], + "name": "eachr", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], +} +`; + +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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": true, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": 16, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 6, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "d", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 60, + 61, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 16, + }, + "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": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "Foo": 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": 7, + "$ref": 16, }, "variables": Array [ Object { @@ -15795,1163 +23924,658 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 6, + 7, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 6, + 7, ], "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 [ + "name": "a", + "references": Array [ Object { - "$ref": 3, + "$ref": 8, }, ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, + "scope": Object { + "$ref": 16, }, - "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, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "b", "range": Array [ - 21, - 24, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 59, + 9, + 10, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "b", "range": Array [ - 21, - 24, + 9, + 10, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "b", + "references": Array [ + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 16, }, }, - ], -} -`; - -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 [ + "$id": 2, + "defs": Array [ Object { - "$id": 5, - "block": Object { + "name": Object { + "name": "c", "range": Array [ - 40, - 79, + 12, + 13, ], - "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, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, + "node": Object { + "range": Array [ + 12, + 13, + ], + "type": "VariableDeclarator", }, - "variableScope": Object { - "$ref": 5, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", }, - "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, - }, - }, - ], + "type": "Variable", }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "eslintUsed": true, + "identifiers": Array [ Object { - "$ref": 4, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", }, ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ + "name": "c", + "references": 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, - }, + "$ref": 10, }, ], + "scope": Object { + "$ref": 16, + }, }, - ], - "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, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "d", "range": Array [ - 21, - 24, + 15, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ 15, - 81, + 16, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "d", "range": Array [ - 21, - 24, + 15, + 16, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "d", + "references": Array [ + Object { + "$ref": 13, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 16, }, }, - ], -} -`; - -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 [ + "$id": 4, + "defs": Array [ Object { - "$id": 5, - "block": Object { + "name": Object { + "name": "e", "range": Array [ - 40, - 67, + 18, + 19, ], - "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, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, + "node": Object { + "range": Array [ + 18, + 19, + ], + "type": "VariableDeclarator", }, - "variableScope": Object { - "$ref": 5, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", }, - "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, - }, - }, - ], + "type": "Variable", }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "eslintUsed": true, + "identifiers": Array [ Object { - "$ref": 4, + "name": "e", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", }, ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ + "name": "e", + "references": 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, - }, + "$ref": 14, }, ], + "scope": Object { + "$ref": 16, + }, }, - ], - "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, + "$id": 5, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "f", "range": Array [ 21, - 24, + 22, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 69, + 21, + 22, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "f", "range": Array [ 21, - 24, + 22, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "f", + "references": Array [ + Object { + "$ref": 15, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 16, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorators.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload.ts 1`] = ` Object { - "$id": 18, + "$id": 7, "block": Object { "range": Array [ 0, - 198, + 101, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 29, + 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 18, + "$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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, }, "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "target": Object { - "$ref": 5, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "target", + "name": "a", "range": Array [ - 13, - 24, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 29, + 19, + 46, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "target", + "name": "a", "range": Array [ - 13, - 24, + 30, + 39, ], "type": "Identifier", }, ], - "name": "target", + "name": "a", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], }, Object { - "$id": 11, + "$id": 6, "block": Object { "range": Array [ - 30, + 47, 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, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 18, + "$ref": 7, }, "variableMap": Object { + "a": Object { + "$ref": 5, + }, "arguments": Object { - "$ref": 7, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 6, }, "variables": Array [ Object { - "$id": 7, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 6, }, }, - ], - }, - 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 [ + "$id": 5, + "defs": Array [ Object { - "$id": 15, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 16, + "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 [ + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 13, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", + "name": Object { + "name": "f", "range": Array [ - 122, - 125, + 56, + 57, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 14, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", + "node": Object { "range": Array [ - 147, - 150, + 47, + 100, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "type": "FunctionDeclaration", }, - "writeExpr": undefined, + "parent": null, + "type": "FunctionName", }, ], - "throughReferences": Array [ - Object { - "$ref": 13, - }, + "eslintUsed": true, + "identifiers": Array [ Object { - "$ref": 14, + "name": "f", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", }, ], - "type": "class", + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 18, + "$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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, }, "variableMap": Object { - "C": Object { - "$ref": 12, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 18, + "$ref": 4, }, "variables": Array [ Object { - "$id": 12, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "a", "range": Array [ - 113, - 114, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 19, + 46, ], - "type": "ClassDeclaration", + "type": "TSDeclareFunction", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "C", + "name": "a", "range": Array [ - 113, - 114, + 30, + 39, ], "type": "Identifier", }, ], - "name": "C", + "name": "a", "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 3, }, }, ], @@ -16959,43 +24583,18 @@ Object { ], "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, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "C": Object { - "$ref": 2, - }, - "dec": Object { + "f": Object { "$ref": 0, }, - "gec": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 18, + "$ref": 4, }, "variables": Array [ Object { @@ -17003,108 +24602,274 @@ Object { "defs": Array [ Object { "name": Object { - "name": "dec", + "name": "f", "range": Array [ 9, - 12, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 29, + 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "dec", + "name": "f", "range": Array [ 9, - 12, + 10, ], "type": "Identifier", }, ], - "name": "dec", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "name": "f", + "references": Array [], "scope": Object { - "$ref": 18, + "$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": 1, - "defs": Array [ + "$id": 6, + "block": Object { + "range": Array [ + 7, + 64, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "gec", + "$id": 5, + "block": Object { "range": Array [ - 39, - 42, + 35, + 62, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, }, - "parent": null, - "type": "FunctionName", + "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, + }, + }, + ], }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", + "$ref": 4, }, ], - "name": "gec", - "references": Array [ - Object { - "$ref": 13, + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Test": Object { + "$ref": 1, }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ Object { - "$ref": 14, + "$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, + }, }, ], - "scope": Object { - "$ref": 18, - }, }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Test": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ Object { - "$id": 2, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Test", "range": Array [ - 113, - 114, + 13, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -17112,46 +24877,71 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "C", + "name": "Test", "range": Array [ - 113, - 114, + 13, + 17, ], "type": "Identifier", }, ], - "name": "C", + "name": "Test", "references": Array [], "scope": Object { - "$ref": 18, + "$ref": 7, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 14, + "$id": 13, "block": Object { "range": Array [ 0, - 71, + 115, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 13, + "$id": 5, "block": Object { "range": Array [ - 20, - 70, + 0, + 15, ], - "type": "TSEnumDeclaration", + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], + }, + Object { + "$id": 7, + "block": Object { + "range": Array [ + 16, + 44, + ], + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, @@ -17160,574 +24950,667 @@ Object { Object { "$id": 6, "from": Object { - "$ref": 13, + "$ref": 7, }, "identifier": Object { "name": "A", "range": Array [ - 33, - 34, + 41, + 42, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 3, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], + }, + Object { + "$id": 12, + "block": Object { + "range": Array [ + 45, + 104, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 12, }, - "writeExpr": Object { - "name": "a", + "identifier": Object { + "name": "B", "range": Array [ - 37, - 38, + 65, + 66, ], "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 13, + "$ref": 12, }, "identifier": Object { "name": "a", "range": Array [ - 37, - 38, + 80, + 91, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 3, }, "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 13, + "$ref": 12, }, "identifier": Object { - "name": "B", + "name": "A", "range": Array [ - 44, - 45, + 88, + 89, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 48, - 53, - ], - "type": "BinaryExpression", - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 11, "from": Object { - "$ref": 13, + "$ref": 12, }, "identifier": Object { - "name": "a", + "name": "A", "range": Array [ - 48, - 49, + 99, + 100, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + "B": Object { + "$ref": 1, + }, + "C": Object { + "$ref": 2, + }, + }, + "upperScope": null, + "variableMap": Object { + "a": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 10, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "C", + "name": Object { + "name": "A", "range": Array [ - 59, - 60, + 5, + 6, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { + "node": Object { "range": Array [ - 63, - 68, + 0, + 15, ], - "type": "BinaryExpression", + "type": "TSTypeAliasDeclaration", }, + "parent": null, + "type": "TypeAliasName", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ 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, + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { - "$id": 12, - "from": Object { - "$ref": 13, - }, - "identifier": Object { + "name": Object { "name": "B", "range": Array [ - 67, - 68, + 26, + 27, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 4, + "node": Object { + "range": Array [ + 16, + 44, + ], + "type": "TSInterfaceDeclaration", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 9, + "parent": null, + "type": "InterfaceName", }, ], - "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, - }, - }, + "eslintUsed": undefined, + "identifiers": Array [ 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, - }, + "range": Array [ + 26, + 27, ], - "scope": Object { - "$ref": 13, - }, + "type": "Identifier", }, ], + "name": "B", + "references": Array [], + "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", + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 45, + 104, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 13, }, }, - ], - "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, + "$id": 3, "defs": Array [ Object { "name": Object { "name": "a", "range": Array [ - 6, - 15, + 110, + 114, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 19, + 110, + 114, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 0, - 19, + 106, + 114, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", "range": Array [ - 6, - 15, + 110, + 114, ], "type": "Identifier", }, ], "name": "a", "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, Object { "$ref": 9, }, ], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, + ], +} +`; + +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", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "E", + "name": "foo", "range": Array [ - 25, - 26, + 7, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 70, + 0, + 27, ], - "type": "TSEnumDeclaration", + "type": "TSImportEqualsDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "ImportBinding", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "E", + "name": "foo", "range": Array [ - 25, - 26, + 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", + "typeMap": Object {}, + "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": 8, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 11, + 20, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], - "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, + "$id": 7, "block": Object { "range": Array [ - 0, - 28, + 27, + 66, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 3, + "$ref": 7, }, "identifier": Object { - "name": "BAR", + "name": "C", "range": Array [ - 15, - 18, + 49, + 50, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 1, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, }, - "writeExpr": Object { + "identifier": Object { + "name": "C", "range": Array [ - 21, - 26, + 63, + 64, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "BAR": Object { - "$ref": 1, + "throughReferences": Array [ + Object { + "$ref": 5, }, + Object { + "$ref": 6, + }, + ], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 4, + }, + }, + "upperScope": Object { + "$ref": 8, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { - "$id": 1, + "$id": 4, "defs": Array [ Object { "name": Object { - "name": "BAR", + "name": "T", "range": Array [ - 15, - 18, + 39, + 40, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 26, + 38, + 51, ], - "type": "TSEnumMember", + "type": "TSTypeParameterDeclaration", }, - "parent": undefined, - "type": "EnumMemberName", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "BAR", + "name": "T", "range": Array [ - 15, - 18, + 39, + 40, ], "type": "Identifier", }, ], - "name": "BAR", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "T", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -17736,16 +25619,27 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { + "typeMap": Object { + "C": Object { "$ref": 0, }, + "R": Object { + "$ref": 1, + }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -17753,334 +25647,205 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ - 5, - 8, + 10, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 28, + 25, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, - "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", + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 8, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, }, - ], - "throughReferences": Array [ Object { - "$ref": 0, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 66, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + ], + "name": "R", + "references": Array [], + "scope": Object { + "$ref": 8, + }, }, ], - "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`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` Object { - "$id": 14, + "$id": 6, "block": Object { "range": Array [ 0, - 67, + 143, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "childScopes": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "foo", + "$id": 5, + "block": Object { "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, + 142, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, + "type": "FunctionDeclaration", }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 14, + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, }, - "identifier": Object { - "name": "e", - "range": Array [ - 60, - 61, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 4, + "variableScope": Object { + "$ref": 5, }, - "writeExpr": undefined, + "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": 13, + "$id": 2, "from": Object { - "$ref": 14, + "$ref": 6, }, "identifier": Object { - "name": "f", + "name": "text", "range": Array [ - 63, - 64, + 6, + 10, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 5, + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 13, + 19, + ], + "type": "Literal", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, }, ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { + "Foo": Object { "$ref": 1, }, - "c": Object { - "$ref": 2, - }, - "d": Object { - "$ref": 3, - }, - "e": Object { - "$ref": 4, - }, - "f": Object { - "$ref": 5, + "text": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 6, }, "variables": Array [ Object { @@ -18088,49 +25853,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "text", "range": Array [ 6, - 7, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 6, - 7, + 19, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, + 20, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "text", "range": Array [ 6, - 7, + 10, ], "type": "Identifier", }, ], - "name": "a", + "name": "text", "references": Array [ Object { - "$ref": 7, + "$ref": 2, + }, + Object { + "$ref": 4, }, ], "scope": Object { - "$ref": 14, + "$ref": 6, }, }, Object { @@ -18138,456 +25906,513 @@ Object { "defs": Array [ Object { "name": Object { - "name": "b", + "name": "Foo", "range": Array [ - 9, - 10, + 37, + 40, ], "type": "Identifier", }, "node": Object { "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, + 28, + 142, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "b", + "name": "Foo", "range": Array [ - 9, - 10, + 37, + 40, ], "type": "Identifier", }, ], - "name": "b", - "references": Array [ - Object { - "$ref": 8, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 6, }, }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/method-overload.ts 1`] = ` +Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 124, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 2, - "defs": Array [ + "$id": 10, + "block": Object { + "range": Array [ + 19, + 123, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "c", + "$id": 9, + "block": Object { "range": Array [ - 12, - 13, + 73, + 121, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { - "range": Array [ - 12, - 13, - ], - "type": "VariableDeclarator", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 10, }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", + "variableMap": Object { + "a": Object { + "$ref": 8, + }, + "arguments": Object { + "$ref": 7, + }, }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 12, - 13, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 8, + "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": 9, + }, + }, ], - "type": "Identifier", }, ], - "name": "c", + "functionExpressionScope": false, + "isStrict": true, "references": Array [ Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "d", + "$id": 5, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "a", "range": Array [ - 15, - 16, + 49, + 60, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 15, - 16, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 10, }, - "parent": Object { + "identifier": Object { + "name": "s", "range": Array [ - 0, - 22, + 59, + 60, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", + "$ref": 5, + }, + Object { + "$ref": 6, }, ], - "name": "d", - "references": Array [ + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "A": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ Object { - "$ref": 11, + "$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": 10, + }, }, ], - "scope": Object { - "$ref": 14, + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 11, + }, + "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": 4, + "$id": 3, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + "s": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "e", + "name": "s", "range": Array [ - 18, - 19, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ + 6, 18, - 19, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, + 18, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "e", + "name": "s", "range": Array [ - 18, - 19, + 6, + 7, ], "type": "Identifier", }, ], - "name": "e", + "name": "s", "references": Array [ Object { - "$ref": 12, + "$ref": 2, + }, + Object { + "$ref": 6, }, ], "scope": Object { - "$ref": 14, + "$ref": 11, }, }, Object { - "$id": 5, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "f", + "name": "A", "range": Array [ - 21, - 22, + 25, + 26, ], "type": "Identifier", }, "node": Object { "range": Array [ - 21, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, + 19, + 123, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "f", + "name": "A", "range": Array [ - 21, - 22, + 25, + 26, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [ - Object { - "$ref": 13, - }, - ], + "name": "A", + "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 11, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/mixed-variable-ref.ts 1`] = ` Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 101, + 32, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { "$id": 1, - "block": Object { + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 0, - 18, + 6, + 9, ], - "type": "TSDeclareFunction", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, + "kind": "w", + "resolved": Object { + "$ref": 0, }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, + "writeExpr": Object { + "range": Array [ + 12, + 13, + ], + "type": "Literal", }, - "variables": Array [], }, Object { - "$id": 3, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 19, - 46, + 24, + 27, ], - "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, - }, + "type": "Identifier", }, - "variableScope": Object { - "$ref": 7, + "kind": "r", + "resolved": Object { + "$ref": 0, }, - "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, - }, - }, - ], + "writeExpr": undefined, }, Object { - "$id": 6, - "block": Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "test", "range": Array [ - 47, - 100, + 19, + 23, ], - "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, + "type": "Identifier", }, - "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, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "f": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -18595,145 +26420,193 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "foo", "range": Array [ - 56, - 57, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 47, - 100, + 6, + 13, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "FunctionName", + "parent": Object { + "range": Array [ + 0, + 14, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "f", + "name": "foo", "range": Array [ - 56, - 57, + 6, + 9, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/namespace.ts 1`] = ` Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ 0, - 47, + 63, ], "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, + "$id": 8, "block": Object { "range": Array [ - 19, - 46, + 24, + 56, ], - "type": "TSDeclareFunction", + "type": "TSModuleBlock", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], + "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": "empty-function", + "type": "block", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 9, }, "variableMap": Object { "a": Object { - "$ref": 2, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { - "$id": 2, + "$id": 5, "defs": Array [ Object { "name": Object { "name": "a", "range": Array [ - 30, - 39, + 43, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ - 19, - 46, + 43, + 48, ], - "type": "TSDeclareFunction", + "type": "VariableDeclarator", }, - "parent": null, - "type": "Parameter", + "parent": Object { + "range": Array [ + 37, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "a", "range": Array [ - 30, - 39, + 43, + 44, ], "type": "Identifier", }, ], "name": "a", - "references": Array [], + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, ], @@ -18741,17 +26614,85 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "references": Array [], + "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", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "f": Object { + "N": Object { + "$ref": 1, + }, + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { @@ -18759,323 +26700,212 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "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": true, + "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 [ - 9, - 10, + 22, + 23, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 18, + 12, + 56, ], - "type": "TSDeclareFunction", + "type": "TSModuleDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "NamespaceName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "f", + "name": "N", "range": Array [ - 9, - 10, + 22, + 23, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [], + "name": "N", + "references": Array [ + Object { + "$ref": 4, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 9, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/rest-element.ts 1`] = ` Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 65, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ - 7, - 64, + 0, + 34, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "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, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, - "isStrict": true, + "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object { - "Test": Object { + "args": Object { + "$ref": 2, + }, + "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 7, + "$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, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", + "identifiers": Array [], + "name": "arguments", "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", + "$ref": 3, }, - "parent": null, - "type": "ClassName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Test", - "range": Array [ - 13, - 17, + "$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", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "args", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + ], + "name": "args", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], - "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", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "a": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -19083,75 +26913,96 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "foo", "range": Array [ - 110, - 114, + 9, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ - 110, - 114, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 114, + 0, + 34, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "foo", "range": Array [ - 110, - 114, + 9, + 12, ], "type": "Identifier", }, ], - "name": "a", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-equals.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 28, + 18, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -19161,20 +27012,20 @@ Object { "name": Object { "name": "foo", "range": Array [ - 7, - 10, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 27, + 17, ], - "type": "TSImportEqualsDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ImportBinding", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -19182,8 +27033,8 @@ Object { Object { "name": "foo", "range": Array [ - 7, - 10, + 5, + 8, ], "type": "Identifier", }, @@ -19191,134 +27042,249 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], } `; -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`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` Object { - "$id": 6, + "$id": 12, "block": Object { "range": Array [ 0, - 143, + 103, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ - 28, - 142, + 0, + 15, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [ + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 32, + 102, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 5, + "$id": 10, + "block": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, }, - "identifier": Object { - "name": "text", - "range": Array [ - 116, - 120, - ], - "type": "Identifier", + "variableMap": Object { + "a": Object { + "$ref": 7, + }, + "arguments": Object { + "$ref": 6, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 10, }, - "writeExpr": undefined, + "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": "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": 10, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 8, + }, + Object { + "$ref": 9, }, ], - "type": "function", + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 12, }, "variableMap": Object { - "arguments": Object { - "$ref": 3, + "C": Object { + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 12, }, "variables": Array [ Object { - "$id": 3, - "defs": Array [], + "$id": 5, + "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 [], - "name": "arguments", + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + ], + "name": "C", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 11, }, }, ], @@ -19328,44 +27294,51 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 12, }, "identifier": Object { - "name": "text", + "name": "A", "range": Array [ - 6, - 10, + 28, + 29, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 19, - ], - "type": "Literal", - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "C": Object { + "$ref": 2, }, - "text": Object { - "$ref": 0, + "a": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 12, }, "variables": Array [ Object { @@ -19373,325 +27346,278 @@ Object { "defs": Array [ Object { "name": Object { - "name": "text", + "name": "A", "range": Array [ + 5, 6, - 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 19, + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 1, + "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 [ - 0, - 20, + 16, + 31, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "text", + "name": "a", "range": Array [ - 6, - 10, + 20, + 31, ], "type": "Identifier", }, ], - "name": "text", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - ], + "name": "a", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 12, }, }, Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ - 37, - 40, + 38, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 28, - 142, + 32, + 102, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ - 37, - 40, + 38, + 39, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 12, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/method-overload.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, - 124, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ - 19, - 123, + 0, + 16, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, - "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, - }, - }, - ], - }, - ], + "childScopes": Array [], "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", + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, + "$ref": 8, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "TSTypeAssertion", }, - "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, + "$ref": 8, }, "identifier": Object { - "name": "s", + "name": "A", "range": Array [ - 6, - 7, + 22, + 23, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", }, + "kind": "w", + "resolved": null, "writeExpr": Object { "range": Array [ - 10, - 18, + 32, + 38, ], - "type": "CallExpression", + "type": "TSAsExpression", }, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 10, + "$ref": 8, }, "identifier": Object { - "name": "Symbol", + "name": "b", "range": Array [ - 10, - 16, + 32, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 37, + 38, ], "type": "Identifier", }, @@ -19701,22 +27627,35 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "A": Object { - "$ref": 1, - }, - "s": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [ Object { @@ -19724,75 +27663,22 @@ Object { "defs": Array [ Object { "name": Object { - "name": "s", + "name": "A", "range": Array [ + 5, 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, + 16, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -19800,8 +27686,8 @@ Object { Object { "name": "A", "range": Array [ - 25, - 26, + 5, + 6, ], "type": "Identifier", }, @@ -19809,159 +27695,188 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 8, }, }, ], } `; - -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, - }, - ], + +exports[`TypeScript scope analysis sourceType: script 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, + 18, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 9, + "$ref": 4, }, "variableMap": Object { - "a": Object { - "$ref": 5, + "arguments": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 3, }, "variables": Array [ Object { - "$id": 5, + "$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", + "name": "T", "range": Array [ - 43, - 44, + 11, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ - 43, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 37, - 48, + 10, + 13, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "T", "range": Array [ - 43, - 44, + 11, + 12, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], + "name": "T", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "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": "FunctionDeclaration", }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": true, + "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/typed-jsx-element.tsx 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 9, + "$ref": 3, }, "identifier": Object { "name": "a", @@ -19978,63 +27893,44 @@ Object { "writeExpr": Object { "range": Array [ 10, - 11, + 37, ], - "type": "Literal", + "type": "JSXElement", }, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 9, + "$ref": 3, }, "identifier": Object { - "name": "a", + "name": "TypeA", "range": Array [ - 57, - 58, + 28, + 33, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ 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, + "$ref": 2, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "N": Object { - "$ref": 1, - }, "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 3, }, "variables": Array [ Object { @@ -20052,99 +27948,52 @@ Object { "node": Object { "range": Array [ 6, - 11, + 37, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 11, + 38, ], "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, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "N", + "name": "a", "range": Array [ - 22, - 23, + 6, + 7, ], "type": "Identifier", }, ], - "name": "N", + "name": "a", "references": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], "scope": Object { - "$ref": 9, + "$ref": 3, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/rest-element.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typed-this.src.ts 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 35, + 31, ], "type": "Program", }, @@ -20154,23 +28003,43 @@ Object { "block": Object { "range": Array [ 0, - 34, + 30, ], "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "String", + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "args": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -20190,57 +28059,22 @@ 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 [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "foo": Object { + "test": Object { "$ref": 0, }, }, @@ -20253,17 +28087,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "test", "range": Array [ 9, - 12, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 34, + 30, ], "type": "FunctionDeclaration", }, @@ -20271,233 +28105,132 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "foo", + "name": "test", "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, + 13, + ], + "type": "Identifier", }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 4, }, - "variableScope": Object { - "$ref": 7, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof.ts 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 43, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 23, + 42, + ], + "type": "TSTypeAliasDeclaration", }, - "variables": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": 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, + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, }, ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 22, + ], + "type": "ObjectExpression", + }, + }, + ], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { + "typeMap": Object { + "B": Object { "$ref": 1, }, - "a": Object { + }, + "upperScope": null, + "variableMap": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { @@ -20505,45 +28238,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "obj", "range": Array [ - 20, - 31, + 4, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 31, + 4, + 22, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 16, - 31, + 0, + 22, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "obj", "range": Array [ - 20, - 31, + 4, + 7, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 5, }, }, Object { @@ -20551,52 +28291,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "C", + "name": "B", "range": Array [ - 38, - 39, + 28, + 29, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 102, + 23, + 42, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "B", "range": Array [ - 38, - 39, + 28, + 29, ], "type": "Identifier", }, ], - "name": "C", + "name": "B", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 5, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, - 40, + 63, ], "type": "Program", }, @@ -20605,38 +28345,82 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 4, + "$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 [ - 17, - 18, + 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": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "TSTypeAssertion", + "kind": "r", + "resolved": Object { + "$ref": 0, }, + "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 8, }, "identifier": Object { "name": "b", "range": Array [ - 25, - 26, + 39, + 40, ], "type": "Identifier", }, @@ -20645,15 +28429,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 8, }, "identifier": Object { "name": "a", "range": Array [ - 28, - 29, + 42, + 43, ], "type": "Identifier", }, @@ -20661,22 +28445,22 @@ Object { "resolved": null, "writeExpr": Object { "range": Array [ - 32, - 38, + 46, + 61, ], "type": "TSAsExpression", }, }, Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 4, + "$ref": 8, }, "identifier": Object { "name": "b", "range": Array [ - 32, - 33, + 46, + 47, ], "type": "Identifier", }, @@ -20684,166 +28468,493 @@ Object { "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": 0, + "$ref": 2, }, Object { - "$ref": 1, + "$ref": 4, }, Object { - "$ref": 2, + "$ref": 5, }, Object { - "$ref": 3, + "$ref": 6, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "obj": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, - "variables": Array [], + "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": true, + "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/type-parameter.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` Object { - "$id": 3, + "$id": 17, "block": Object { "range": Array [ 0, - 19, + 165, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 16, "block": Object { "range": Array [ - 0, - 18, + 25, + 164, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 66, + 79, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 76, + 79, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 81, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 84, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 95, + 98, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 125, + 128, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, }, + "writeExpr": undefined, }, - ], - }, - ], - "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", + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", "range": Array [ - 9, - 10, + 130, + 143, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 0, - 18, + 140, + 143, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "FunctionName", + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 145, + 149, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 148, + 149, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 159, + 162, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 15, }, ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 3, + "type": "interface", + "typeMap": Object { + "T": 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 [], + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 17, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 65, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "T", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 107, + 129, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$ref": 16, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 17, }, "identifier": Object { - "name": "a", + "name": "obj", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, @@ -20853,23 +28964,41 @@ Object { }, "writeExpr": Object { "range": Array [ - 10, - 37, + 12, + 24, ], - "type": "JSXElement", + "type": "ObjectExpression", }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + ], "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 1, + }, + }, "upperScope": null, "variableMap": Object { - "a": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 17, }, "variables": Array [ Object { @@ -20877,124 +29006,247 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "obj", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 6, - 37, + 24, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 38, + 24, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "obj", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "a", + "name": "obj", "references": Array [ Object { - "$ref": 1, + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 15, }, ], "scope": Object { - "$ref": 2, + "$ref": 17, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 164, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 17, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-return-type.ts 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 43, + 83, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "childScopes": 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 { + "$id": 4, + "block": Object { "range": Array [ - 10, - 22, + 0, + 82, ], - "type": "ObjectExpression", + "type": "FunctionDeclaration", }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 4, }, - "writeExpr": undefined, + "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", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "obj": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -21002,239 +29254,246 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "f", "range": Array [ - 4, - 7, + 9, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 82, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "obj", + "name": "f", "range": Array [ - 4, - 7, + 9, + 10, ], "type": "Identifier", }, ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "name": "f", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 63, + 62, ], "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, - }, + "childScopes": Array [ Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { + "$id": 6, + "block": Object { "range": Array [ - 46, + 0, 61, ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, + "type": "FunctionDeclaration", }, - "identifier": Object { - "name": "b", - "range": Array [ - 46, - 47, - ], - "type": "Identifier", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "g", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, + "upperScope": Object { + "$ref": 7, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "g": Object { + "$ref": 3, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 6, }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - 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": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 30, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 3, + "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": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "obj": Object { + "g": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -21242,68 +29501,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "g", "range": Array [ - 4, - 7, + 9, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 61, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "obj", + "name": "g", "range": Array [ - 4, - 7, + 9, + 10, ], "type": "Identifier", }, ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 7, - }, - ], + "name": "g", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` Object { - "$id": 8, + "$id": 11, "block": Object { "range": Array [ 0, - 165, + 147, ], "type": "Program", }, @@ -21312,15 +29555,15 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { "name": "obj", "range": Array [ - 6, - 9, + 4, + 7, ], "type": "Identifier", }, @@ -21330,41 +29573,47 @@ Object { }, "writeExpr": Object { "range": Array [ - 12, - 24, + 10, + 22, ], "type": "ObjectExpression", }, }, Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { - "name": "obj", + "name": "obj2", "range": Array [ - 61, - 64, + 27, + 43, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 0, + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 46, + 58, + ], + "type": "ObjectExpression", }, - "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { "name": "obj", "range": Array [ - 76, - 79, + 40, + 43, ], "type": "Identifier", }, @@ -21375,34 +29624,40 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 7, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { - "name": "obj", + "name": "value", "range": Array [ - 95, - 98, + 65, + 70, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 0, + "$ref": 2, + }, + "writeExpr": Object { + "range": Array [ + 87, + 99, + ], + "type": "ObjectExpression", }, - "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 8, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { "name": "obj", "range": Array [ - 125, - 128, + 81, + 84, ], "type": "Identifier", }, @@ -21413,34 +29668,40 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 9, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { - "name": "obj", + "name": "element", "range": Array [ - 140, - 143, + 105, + 112, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 0, + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 132, + 146, + ], + "type": "ArrayExpression", }, - "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { "name": "obj", "range": Array [ - 159, - 162, + 123, + 126, ], "type": "Identifier", }, @@ -21453,14 +29714,24 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { + "element": Object { + "$ref": 3, + }, "obj": Object { "$ref": 0, }, + "obj2": Object { + "$ref": 1, + }, + "value": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 8, + "$ref": 11, }, "variables": Array [ Object { @@ -21470,35 +29741,35 @@ Object { "name": Object { "name": "obj", "range": Array [ - 6, - 9, + 4, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 24, + 4, + 22, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 24, + 22, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", "range": Array [ - 6, - 9, + 4, + 7, ], "type": "Identifier", }, @@ -21506,152 +29777,211 @@ Object { "name": "obj", "references": Array [ Object { - "$ref": 1, + "$ref": 4, }, Object { - "$ref": 2, + "$ref": 6, }, Object { - "$ref": 3, + "$ref": 8, }, Object { - "$ref": 4, + "$ref": 10, }, + ], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { - "$ref": 5, + "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": true, + "identifiers": Array [ Object { - "$ref": 6, + "name": "obj2", + "range": Array [ + 27, + 43, + ], + "type": "Identifier", }, + ], + "name": "obj2", + "references": Array [ Object { - "$ref": 7, + "$ref": 5, }, ], "scope": Object { - "$ref": 8, + "$ref": 11, }, }, - ], -} -`; - -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 [ + "$id": 2, + "defs": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", + "name": Object { + "name": "value", "range": Array [ - 30, - 31, + 65, + 70, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "node": Object { + "range": Array [ + 63, + 99, + ], + "type": "VariableDeclarator", }, - "writeExpr": undefined, + "parent": Object { + "range": Array [ + 59, + 99, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "value", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", }, - "arguments": Object { - "$ref": 1, + ], + "name": "value", + "references": Array [ + Object { + "$ref": 7, }, + ], + "scope": Object { + "$ref": 11, }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ + }, + Object { + "$id": 3, + "defs": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, + "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", }, - 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, - }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "element", + "range": Array [ + 105, + 112, ], - "scope": Object { - "$ref": 4, - }, + "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": 2, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -21659,14 +29989,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { + "typeMap": Object { + "Foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -21674,177 +30005,147 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "Foo", "range": Array [ - 9, - 10, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 19, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "Foo", "range": Array [ - 9, - 10, + 5, + 8, ], "type": "Identifier", }, ], - "name": "f", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ 0, - 62, + 49, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "g", + "name": Object { + "name": "x", "range": Array [ - 28, - 29, + 4, + 47, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "node": Object { + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", }, - "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, + "parent": Object { + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", }, + "type": "Variable", }, + ], + "eslintUsed": true, + "identifiers": Array [ 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, - }, + "name": "x", + "range": Array [ + 4, + 47, ], - "scope": Object { - "$ref": 4, - }, + "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", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "g": Object { + "x": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 1, }, "variables": Array [ Object { @@ -21852,52 +30153,58 @@ Object { "defs": Array [ Object { "name": Object { - "name": "g", + "name": "x", "range": Array [ - 9, - 10, + 4, + 45, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 61, + 46, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "g", + "name": "x", "range": Array [ - 9, - 10, + 4, + 45, ], "type": "Identifier", }, ], - "name": "g", + "name": "x", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 1, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` Object { - "$id": 11, + "$id": 3, "block": Object { "range": Array [ 0, - 147, + 13, ], "type": "Program", }, @@ -21906,182 +30213,58 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 11, + "$ref": 3, }, "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { + "name": "K", "range": Array [ + 9, 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, - }, + "resolved": null, "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, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 3, }, "identifier": Object { - "name": "obj", + "name": "T", "range": Array [ - 81, - 84, + 7, + 8, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ 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", - }, + "$ref": 1, }, 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, + "$ref": 2, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "element": Object { - "$ref": 3, - }, - "obj": Object { + "x": Object { "$ref": 0, }, - "obj2": Object { - "$ref": 1, - }, - "value": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 11, + "$ref": 3, }, "variables": Array [ Object { @@ -22089,263 +30272,400 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "x", "range": Array [ 4, - 7, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 22, + 11, ], "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, + 12, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "obj2", + "name": "x", "range": Array [ - 27, - 43, + 4, + 11, ], "type": "Identifier", }, ], - "name": "obj2", - "references": Array [ - Object { - "$ref": 5, - }, - ], + "name": "x", + "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 3, }, }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-infer.ts 1`] = ` +Object { + "$id": 14, + "block": Object { + "range": Array [ + 0, + 147, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 2, - "defs": Array [ + "$id": 13, + "block": Object { + "range": Array [ + 0, + 146, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "name": Object { - "name": "value", + "$id": 2, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 65, - 70, + 23, + 24, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 63, - 99, + 40, + 41, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ 59, - 99, + 60, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 75, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "name": "value", - "references": Array [ Object { - "$ref": 7, + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 79, + 80, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 3, - "defs": Array [ Object { - "name": Object { - "name": "element", + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 95, + 96, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "Promise", "range": Array [ 105, 112, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 104, - 146, + 119, + 120, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 100, - 146, + 124, + 125, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 144, + 145, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", + "$ref": 11, }, ], - "name": "element", - "references": Array [ + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ Object { - "$ref": 9, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, }, ], - "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 [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "Unpacked": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 14, }, "variables": Array [ Object { @@ -22353,151 +30673,212 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "Unpacked", "range": Array [ - 4, - 47, + 5, + 13, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 48, + 146, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "Unpacked", "range": Array [ - 4, - 47, + 5, + 13, ], "type": "Identifier", }, ], - "name": "x", + "name": "Unpacked", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 14, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, - 47, + 50, ], "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 [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 5, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "name": Object { - "name": "x", + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", "range": Array [ - 4, - 45, + 21, + 22, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "LinkedList", "range": Array [ - 4, - 45, + 33, + 43, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", "range": Array [ - 0, - 46, + 44, + 45, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ Object { - "name": "x", - "range": Array [ - 4, - 45, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, + }, }, ], - "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 [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "LinkedList": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [ Object { @@ -22505,104 +30886,48 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "LinkedList", "range": Array [ - 4, - 11, + 5, + 15, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 12, + 49, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "LinkedList", "range": Array [ - 4, - 11, + 5, + 15, ], "type": "Identifier", }, ], - "name": "x", + "name": "LinkedList", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 6, }, }, ], } `; -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, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22613,9 +30938,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -22623,7 +30971,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22655,7 +31003,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -22669,7 +31017,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22678,7 +31026,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22689,9 +31037,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -22699,7 +31070,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22731,7 +31102,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -22745,7 +31116,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22754,7 +31125,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22765,9 +31136,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -22775,7 +31169,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22807,7 +31201,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -22821,7 +31215,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22830,7 +31224,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly-plus.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22841,9 +31235,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -22851,7 +31268,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22883,7 +31300,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -22897,7 +31314,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22906,7 +31323,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22914,24 +31331,96 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22939,24 +31428,96 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "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": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22967,9 +31528,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -22977,7 +31561,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -23009,7 +31593,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23023,7 +31607,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -23032,7 +31616,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference-generic.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -23043,9 +31627,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23053,7 +31660,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -23085,7 +31692,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23099,7 +31706,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -23108,7 +31715,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference-generic-nested.src.ts 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -23119,9 +31726,52 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 13, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23129,7 +31779,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -23161,7 +31811,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23175,7 +31825,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -23198,6 +31848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23237,7 +31888,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23274,6 +31925,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23313,7 +31965,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23350,6 +32002,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23389,7 +32042,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23426,6 +32079,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23465,7 +32119,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23488,7 +32142,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -23496,18 +32150,90 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "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": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; @@ -23527,6 +32253,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "obj": Object { @@ -23566,7 +32293,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", @@ -23589,7 +32316,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-type-operator.src.ts 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -23600,9 +32327,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23613,7 +32363,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -23645,7 +32395,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23659,7 +32409,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, Object { @@ -23691,7 +32441,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "y", @@ -23705,7 +32455,7 @@ Object { "name": "y", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -23750,6 +32500,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23789,7 +32540,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23826,6 +32577,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "intersection": Object { @@ -23874,7 +32626,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "union", @@ -23920,7 +32672,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "intersection", @@ -23966,7 +32718,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "precedence1", @@ -24012,7 +32764,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "precedence2", @@ -24035,7 +32787,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24043,17 +32795,89 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; diff --git a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap index 0fb95a3acc74..e9cf7457add9 100644 --- a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap @@ -26,6 +26,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -41,6 +42,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -76,6 +78,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -91,6 +94,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -102,7 +106,7 @@ Object { exports[`TSX fixtures/react-typed-props.src 1`] = ` Object { - "$id": 7, + "$id": 10, "block": Object { "range": Array [ 0, @@ -112,7 +116,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -122,7 +126,32 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, + "block": Object { + "range": Array [ + 31, + 63, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [], + }, + Object { + "$id": 8, "block": Object { "range": Array [ 80, @@ -135,9 +164,28 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 5, + "$ref": 8, + }, + "identifier": Object { + "name": "Props", + "range": Array [ + 100, + 105, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, }, "identifier": Object { "name": "props", @@ -149,41 +197,46 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 5, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "arguments": Object { - "$ref": 2, + "$ref": 4, }, "props": Object { - "$ref": 3, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { - "$id": 2, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, Object { - "$id": 3, + "$id": 5, "defs": Array [ Object { "name": Object { @@ -219,11 +272,11 @@ Object { "name": "props", "references": Array [ Object { - "$ref": 4, + "$ref": 7, }, ], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -234,19 +287,24 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Props": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 10, }, "variableMap": Object { "App": Object { - "$ref": 1, + "$ref": 2, }, "React": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [ Object { @@ -292,11 +350,55 @@ Object { "name": "React", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 9, }, }, Object { "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Props", + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 31, + 63, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Props", + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + }, + ], + "name": "Props", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { @@ -332,7 +434,7 @@ Object { "name": "App", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 9, }, }, ], @@ -343,10 +445,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 10, }, "variables": Array [], } diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index 03506477a626..240bd76795c9 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -2,7 +2,7 @@ exports[`typescript fixtures/babylon-convergence/type-parameter-whitespace-loc.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12,7 +12,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22,7 +22,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36,8 +36,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "arguments": Object { @@ -45,7 +50,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -56,7 +61,47 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -67,8 +112,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -76,7 +122,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -116,7 +162,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -127,10 +173,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -138,7 +185,7 @@ Object { exports[`typescript fixtures/babylon-convergence/type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -148,7 +195,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -158,7 +205,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -172,8 +219,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "arguments": Object { @@ -181,7 +233,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -192,7 +244,47 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 37, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -203,8 +295,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -212,7 +305,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -252,7 +345,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -263,10 +356,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -308,6 +402,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -368,6 +463,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -428,6 +524,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -439,7 +536,7 @@ Object { exports[`typescript fixtures/basics/abstract-class-with-abstract-method.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -449,7 +546,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -459,7 +556,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -470,11 +567,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Promise", + "range": Array [ + 68, + 75, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "AbstractSocket": Object { @@ -482,7 +602,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -522,7 +642,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -531,10 +651,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "AbstractSocket": Object { @@ -542,7 +667,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -582,7 +707,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -591,12 +716,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -638,6 +768,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -698,6 +829,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -758,6 +890,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -803,6 +936,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -863,6 +997,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -923,6 +1058,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -968,6 +1104,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1028,6 +1165,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1088,6 +1226,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1133,6 +1272,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1193,6 +1333,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1253,6 +1394,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1264,7 +1406,7 @@ Object { exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1274,7 +1416,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -1284,7 +1426,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -1295,11 +1437,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Promise", + "range": Array [ + 60, + 67, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "AbstractSocket": Object { @@ -1307,7 +1472,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -1347,7 +1512,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -1356,10 +1521,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "AbstractSocket": Object { @@ -1367,7 +1537,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -1407,7 +1577,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -1416,12 +1586,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -1429,7 +1604,7 @@ Object { exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -1439,7 +1614,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -1447,20 +1622,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 7, + 31, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "I": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "I", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 31, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "I", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + ], + "name": "I", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -1468,10 +1715,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -1529,6 +1777,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1599,6 +1848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1664,6 +1914,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -1754,6 +2005,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -1824,6 +2076,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1889,6 +2142,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1953,6 +2207,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1968,6 +2223,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1979,7 +2235,7 @@ Object { exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -1989,7 +2245,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, @@ -1999,7 +2255,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2012,9 +2268,47 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 5, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, }, "identifier": Object { "name": "b", @@ -2026,27 +2320,79 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 1, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 6, }, "variableMap": Object { "b": Object { - "$ref": 0, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 3, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -2082,11 +2428,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 1, + "$ref": 4, }, ], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -2097,12 +2443,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [], }, @@ -2112,10 +2459,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } @@ -2167,6 +2515,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2198,6 +2547,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function-expression-name", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2258,6 +2608,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -2273,6 +2624,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2394,6 +2746,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -2584,6 +2937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -2644,6 +2998,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2755,6 +3110,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -2846,6 +3202,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -2910,6 +3267,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2921,7 +3279,7 @@ Object { exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2931,7 +3289,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -2939,31 +3297,160 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 61, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 16, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 41, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 61, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "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 [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -2971,7 +3458,7 @@ Object { exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, @@ -2981,7 +3468,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2989,31 +3476,232 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 19, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 47, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 46, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 6, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 5, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 67, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } @@ -3087,6 +3775,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3109,6 +3798,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3120,7 +3810,7 @@ Object { exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -3130,7 +3820,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -3145,7 +3835,7 @@ Object { Object { "$id": 0, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "x", @@ -3159,19 +3849,40 @@ Object { "resolved": null, "writeExpr": undefined, }, + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, ], "throughReferences": Array [ Object { "$ref": 0, }, + Object { + "$ref": 1, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -3183,12 +3894,16 @@ Object { Object { "$ref": 0, }, + Object { + "$ref": 1, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -3242,6 +3957,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -3261,6 +3977,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3318,6 +4035,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -3337,6 +4055,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3419,6 +4138,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3493,6 +4213,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3538,6 +4259,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3620,6 +4342,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -3684,6 +4407,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3729,6 +4453,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3811,6 +4536,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -3875,6 +4601,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3930,6 +4657,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3990,6 +4718,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4068,6 +4797,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -4128,6 +4858,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -4188,6 +4919,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4243,6 +4975,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4283,6 +5016,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4314,6 +5048,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4374,6 +5109,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4434,6 +5170,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4489,6 +5226,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4529,6 +5267,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4560,6 +5299,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4620,6 +5360,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4680,6 +5421,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4691,7 +5433,7 @@ Object { exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -4701,7 +5443,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -4711,7 +5453,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -4721,7 +5463,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 23, @@ -4735,8 +5477,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "arguments": Object { @@ -4744,7 +5491,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -4755,13 +5502,53 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 23, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, }, }, ], }, Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 51, @@ -4775,27 +5562,72 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "arguments": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 51, + 54, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, }, }, ], @@ -4806,8 +5638,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "C": Object { @@ -4815,7 +5648,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -4855,7 +5688,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -4866,8 +5699,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -4875,7 +5709,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -4915,7 +5749,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -4926,10 +5760,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -4971,6 +5806,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -5031,6 +5867,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -5091,6 +5928,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5136,6 +5974,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -5196,6 +6035,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -5256,6 +6096,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5311,6 +6152,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -5385,6 +6227,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -5445,6 +6288,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -5505,6 +6349,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5516,7 +6361,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5526,7 +6371,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5536,7 +6381,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5547,11 +6392,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "MyInterface", + "range": Array [ + 66, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -5559,7 +6427,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -5599,7 +6467,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -5611,7 +6479,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "MyOtherClass", @@ -5630,10 +6498,14 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 3, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -5641,7 +6513,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -5681,7 +6553,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -5694,12 +6566,16 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 3, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -5707,7 +6583,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5717,7 +6593,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5727,7 +6603,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5738,11 +6614,38 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -5750,7 +6653,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { @@ -5790,7 +6693,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 5, }, }, ], @@ -5802,7 +6745,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "Bar", @@ -5821,10 +6764,14 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 4, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -5832,7 +6779,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { @@ -5872,7 +6819,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -5885,12 +6832,16 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 4, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [], } @@ -5898,7 +6849,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, @@ -5908,7 +6859,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5918,7 +6869,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5929,11 +6880,78 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "D", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -5941,7 +6959,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -5981,7 +6999,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 7, }, }, ], @@ -5993,7 +7051,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 8, }, "identifier": Object { "name": "Bar", @@ -6012,10 +7070,20 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object { "Foo": Object { @@ -6023,7 +7091,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -6063,7 +7131,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -6076,12 +7144,22 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 9, }, "variables": Array [], } @@ -6089,7 +7167,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6099,7 +7177,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6109,7 +7187,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6119,7 +7197,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 20, @@ -6133,8 +7211,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "arguments": Object { @@ -6142,7 +7225,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -6153,7 +7236,47 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 23, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, }, }, ], @@ -6164,8 +7287,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -6173,7 +7297,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -6213,7 +7337,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -6224,8 +7348,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6233,7 +7358,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -6273,7 +7398,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -6284,10 +7409,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -6295,7 +7421,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -6305,7 +7431,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6315,7 +7441,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6325,7 +7451,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 20, @@ -6336,11 +7462,38 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "arguments": Object { @@ -6348,7 +7501,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -6359,7 +7512,47 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 29, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 5, }, }, ], @@ -6368,10 +7561,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6379,7 +7577,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -6419,7 +7617,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -6428,10 +7626,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -6439,7 +7642,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -6479,7 +7682,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -6488,12 +7691,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } @@ -6501,7 +7709,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6511,7 +7719,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -6521,7 +7729,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -6532,11 +7740,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -6544,7 +7775,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -6584,7 +7815,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -6593,10 +7824,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -6604,7 +7840,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -6644,7 +7880,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -6653,12 +7889,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -6666,7 +7907,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6676,7 +7917,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6686,7 +7927,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -6697,11 +7938,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "MyInterface", + "range": Array [ + 45, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -6709,7 +7973,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -6749,7 +8013,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -6761,7 +8025,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "MyOtherClass", @@ -6780,10 +8044,14 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 3, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -6791,7 +8059,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -6831,7 +8099,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -6844,12 +8112,16 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 3, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -6857,7 +8129,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6867,7 +8139,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6877,7 +8149,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -6888,11 +8160,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -6900,7 +8215,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -6940,7 +8255,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -6949,10 +8264,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -6960,7 +8283,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -7000,7 +8323,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -7009,12 +8332,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -7022,7 +8353,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -7032,7 +8363,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, @@ -7042,7 +8373,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -7053,11 +8384,74 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -7065,7 +8459,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -7105,7 +8499,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -7114,10 +8508,21 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -7125,7 +8530,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -7165,7 +8570,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -7174,12 +8579,23 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } @@ -7187,7 +8603,7 @@ Object { exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -7197,7 +8613,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -7207,7 +8623,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -7231,8 +8647,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -7257,7 +8674,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 35, @@ -7271,8 +8688,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 5, + }, + }, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -7280,7 +8702,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -7291,13 +8713,53 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 38, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 6, }, }, ], }, Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 50, @@ -7311,27 +8773,28 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { - "$ref": 6, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { - "$id": 6, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -7342,8 +8805,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -7351,7 +8815,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -7391,7 +8855,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -7402,8 +8866,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "C": Object { @@ -7411,7 +8876,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -7451,7 +8916,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -7462,10 +8927,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -7473,7 +8939,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 15, + "$id": 26, "block": Object { "range": Array [ 0, @@ -7483,7 +8949,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 25, "block": Object { "range": Array [ 0, @@ -7493,7 +8959,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 14, "block": Object { "range": Array [ 0, @@ -7503,7 +8969,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 13, "block": Object { "range": Array [ 60, @@ -7517,12 +8983,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 14, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 14, }, "variables": Array [], }, @@ -7531,9 +8998,47 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 9, + "$ref": 14, + }, + "identifier": Object { + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 8, + }, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 14, }, "identifier": Object { "name": "Base", @@ -7545,41 +9050,94 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 6, + "$ref": 9, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 10, + }, + ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 8, + }, + }, "upperScope": Object { - "$ref": 14, + "$ref": 25, }, "variableMap": Object { "Base": Object { - "$ref": 6, + "$ref": 9, }, "arguments": Object { - "$ref": 5, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 14, }, "variables": Array [ Object { - "$id": 5, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 14, }, }, Object { - "$id": 6, + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 37, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 11, + }, + ], + "scope": Object { + "$ref": 14, + }, + }, + Object { + "$id": 9, "defs": Array [ Object { "name": Object { @@ -7615,17 +9173,17 @@ Object { "name": "Base", "references": Array [ Object { - "$ref": 7, + "$ref": 12, }, ], "scope": Object { - "$ref": 9, + "$ref": 14, }, }, ], }, Object { - "$id": 11, + "$id": 17, "block": Object { "range": Array [ 86, @@ -7636,23 +9194,48 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 16, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "I", + "range": Array [ + 123, + 124, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 16, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 14, + "$ref": 25, }, "variableMap": Object { "X": Object { - "$ref": 10, + "$ref": 15, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { - "$id": 10, + "$id": 15, "defs": Array [ Object { "name": Object { @@ -7688,13 +9271,13 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 17, }, }, ], }, Object { - "$id": 13, + "$id": 19, "block": Object { "range": Array [ 130, @@ -7708,20 +9291,21 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 14, + "$ref": 25, }, "variableMap": Object { "C": Object { - "$ref": 12, + "$ref": 18, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { - "$id": 12, + "$id": 18, "defs": Array [ Object { "name": Object { @@ -7757,7 +9341,147 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 19, + }, + }, + ], + }, + Object { + "$id": 20, + "block": Object { + "range": Array [ + 142, + 157, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 25, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 25, + }, + "variables": Array [], + }, + Object { + "$id": 24, + "block": Object { + "range": Array [ + 158, + 206, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 22, + "from": Object { + "$ref": 24, + }, + "identifier": Object { + "name": "args", + "range": Array [ + 188, + 192, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 23, + "from": Object { + "$ref": 24, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 21, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 22, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 21, + }, + }, + "upperScope": Object { + "$ref": 25, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 25, + }, + "variables": Array [ + Object { + "$id": 21, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 175, + 176, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 174, + 177, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 175, + 176, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 23, + }, + ], + "scope": Object { + "$ref": 24, }, }, ], @@ -7767,9 +9491,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 14, + "$ref": 25, }, "identifier": Object { "name": "M", @@ -7786,9 +9510,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 14, + "$ref": 25, }, "identifier": Object { "name": "C", @@ -7805,10 +9529,22 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 22, + }, + ], "type": "module", + "typeMap": Object { + "Constructor": Object { + "$ref": 4, + }, + "I": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 15, + "$ref": 26, }, "variableMap": Object { "C": Object { @@ -7822,7 +9558,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { @@ -7862,11 +9598,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 3, + "$ref": 5, }, ], "scope": Object { - "$ref": 14, + "$ref": 25, }, }, Object { @@ -7906,7 +9642,7 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 25, }, }, Object { @@ -7946,11 +9682,99 @@ Object { "name": "C", "references": Array [ Object { - "$ref": 4, + "$ref": 6, }, ], "scope": Object { - "$ref": 14, + "$ref": 25, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "I", + "range": Array [ + 152, + 153, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 142, + 157, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "I", + "range": Array [ + 152, + 153, + ], + "type": "Identifier", + }, + ], + "name": "I", + "references": Array [ + Object { + "$ref": 16, + }, + ], + "scope": Object { + "$ref": 25, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "Constructor", + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 158, + 206, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Constructor", + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + }, + ], + "name": "Constructor", + "references": Array [ + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 25, }, }, ], @@ -7959,12 +9783,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 22, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 26, }, "variables": Array [], } @@ -7972,7 +9801,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, @@ -7982,7 +9811,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, @@ -7992,7 +9821,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, @@ -8003,22 +9832,88 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "M", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 8, }, "variableMap": Object { "Base": Object { - "$ref": 2, + "$ref": 3, }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 7, }, "variables": Array [ Object { @@ -8029,11 +9924,55 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, Object { "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 36, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 3, "defs": Array [ Object { "name": Object { @@ -8069,7 +10008,7 @@ Object { "name": "Base", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -8078,10 +10017,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object { "M": Object { @@ -8089,7 +10036,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -8129,7 +10076,7 @@ Object { "name": "M", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -8138,12 +10085,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 9, }, "variables": Array [], } @@ -8207,6 +10162,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -8271,6 +10227,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -8335,6 +10292,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8380,6 +10338,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -8440,6 +10399,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -8500,6 +10460,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8591,6 +10552,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -8702,6 +10664,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -8874,6 +10837,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8941,6 +10905,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9005,6 +10970,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9069,6 +11035,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9175,6 +11142,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -9386,6 +11354,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -9446,6 +11415,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -9506,6 +11476,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9561,6 +11532,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9607,6 +11579,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9626,6 +11599,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -9690,6 +11664,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -9754,6 +11729,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9821,6 +11797,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9885,6 +11862,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9949,6 +11927,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10055,6 +12034,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -10266,6 +12246,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -10326,6 +12307,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -10386,6 +12368,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10492,6 +12475,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -10703,6 +12687,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -10763,6 +12748,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -10823,6 +12809,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10904,6 +12891,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11025,6 +13013,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -11085,6 +13074,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -11145,6 +13135,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11190,6 +13181,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -11250,6 +13242,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -11310,6 +13303,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11365,6 +13359,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11439,6 +13434,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11499,6 +13495,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11559,6 +13556,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11570,7 +13568,7 @@ Object { exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -11580,7 +13578,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -11590,7 +13588,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -11600,7 +13598,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 25, @@ -11614,8 +13612,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "arguments": Object { @@ -11623,7 +13626,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -11634,13 +13637,53 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 28, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, }, }, ], }, Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 63, @@ -11654,27 +13697,72 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "arguments": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 63, + 66, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, }, }, ], @@ -11685,8 +13773,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "A": Object { @@ -11694,7 +13783,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -11734,7 +13823,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -11745,8 +13834,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "A": Object { @@ -11754,7 +13844,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -11794,7 +13884,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -11805,10 +13895,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -11816,7 +13907,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -11826,7 +13917,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -11836,7 +13927,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -11850,8 +13941,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -11859,7 +13955,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -11899,7 +13995,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -11910,8 +14046,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -11919,7 +14056,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -11959,7 +14096,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -11970,10 +14107,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -11981,7 +14119,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -11991,7 +14129,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12001,7 +14139,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12012,11 +14150,38 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -12024,7 +14189,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -12064,7 +14229,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, }, }, ], @@ -12073,10 +14278,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -12084,7 +14294,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -12124,7 +14334,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -12133,12 +14343,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -12146,7 +14361,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12156,7 +14371,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12166,7 +14381,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -12180,8 +14395,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "__P": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "A": Object { @@ -12189,7 +14409,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -12229,7 +14449,47 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "__P", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "__P", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + ], + "name": "__P", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -12240,8 +14500,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "A": Object { @@ -12249,7 +14510,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -12289,7 +14550,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -12300,10 +14561,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -12311,7 +14573,7 @@ Object { exports[`typescript fixtures/basics/const-assertions.src 1`] = ` Object { - "$id": 10, + "$id": 16, "block": Object { "range": Array [ 13, @@ -12321,7 +14583,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 15, "block": Object { "range": Array [ 13, @@ -12336,7 +14598,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 9, + "$ref": 15, }, "identifier": Object { "name": "x", @@ -12361,7 +14623,24 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 9, + "$ref": 15, + }, + "identifier": Object { + "name": "const", + "range": Array [ + 27, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 15, }, "identifier": Object { "name": "y", @@ -12384,9 +14663,26 @@ Object { }, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 9, + "$ref": 15, + }, + "identifier": Object { + "name": "const", + "range": Array [ + 83, + 88, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 15, }, "identifier": Object { "name": "z", @@ -12409,9 +14705,26 @@ Object { }, }, Object { - "$id": 6, + "$id": 8, "from": Object { - "$ref": 9, + "$ref": 15, + }, + "identifier": Object { + "name": "const", + "range": Array [ + 157, + 162, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 15, }, "identifier": Object { "name": "x", @@ -12434,9 +14747,26 @@ Object { }, }, Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 9, + "$ref": 15, + }, + "identifier": Object { + "name": "const", + "range": Array [ + 187, + 192, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 15, }, "identifier": Object { "name": "y", @@ -12459,9 +14789,26 @@ Object { }, }, Object { - "$id": 8, + "$id": 12, "from": Object { - "$ref": 9, + "$ref": 15, + }, + "identifier": Object { + "name": "const", + "range": Array [ + 235, + 240, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 15, }, "identifier": Object { "name": "z", @@ -12483,11 +14830,48 @@ Object { "type": "TSTypeAssertion", }, }, + Object { + "$id": 14, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "const", + "range": Array [ + 298, + 303, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 14, + }, ], - "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 16, }, "variableMap": Object { "x": Object { @@ -12501,7 +14885,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 15, }, "variables": Array [ Object { @@ -12583,11 +14967,11 @@ Object { "$ref": 3, }, Object { - "$ref": 6, + "$ref": 9, }, ], "scope": Object { - "$ref": 9, + "$ref": 15, }, }, Object { @@ -12666,14 +15050,14 @@ Object { "name": "y", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 7, + "$ref": 11, }, ], "scope": Object { - "$ref": 9, + "$ref": 15, }, }, Object { @@ -12752,14 +15136,14 @@ Object { "name": "z", "references": Array [ Object { - "$ref": 5, + "$ref": 7, }, Object { - "$ref": 8, + "$ref": 13, }, ], "scope": Object { - "$ref": 9, + "$ref": 15, }, }, ], @@ -12768,12 +15152,32 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 14, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 16, }, "variables": Array [], } @@ -12841,6 +15245,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -12948,6 +15353,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -13008,6 +15414,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13053,6 +15460,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -13113,6 +15521,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13173,6 +15582,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13218,6 +15628,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -13278,6 +15689,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13338,6 +15750,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13448,6 +15861,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13473,6 +15887,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13770,6 +16185,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -13816,6 +16232,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13926,6 +16343,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13951,6 +16369,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14069,6 +16488,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -14154,6 +16574,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -14218,6 +16639,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14293,6 +16715,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -14308,6 +16731,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14421,6 +16845,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14496,6 +16921,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -14511,6 +16937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14624,6 +17051,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14681,6 +17109,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -14700,6 +17129,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14757,6 +17187,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -14776,6 +17207,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14847,6 +17279,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14954,6 +17387,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15014,6 +17448,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15085,6 +17520,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15192,6 +17628,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15252,6 +17689,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15263,7 +17701,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15273,7 +17711,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15283,7 +17721,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 15, @@ -15297,14 +17735,60 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 23, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -15312,12 +17796,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -15327,10 +17812,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -15338,7 +17824,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -15348,7 +17834,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15358,7 +17844,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 15, @@ -15372,128 +17858,97 @@ Object { "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-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", + "typeMap": Object { + "T": Object { + "$ref": 0, + }, + "U": Object { + "$ref": 1, + }, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", "upperScope": Object { "$ref": 3, }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "T", "range": Array [ - 13, - 16, + 21, + 22, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, + 20, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "U", + "range": Array [ 24, + 25, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "node": Object { + "range": Array [ + 20, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "U", "range": Array [ - 13, - 16, + 24, + 25, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "U", "references": Array [], "scope": Object { "$ref": 2, @@ -15507,59 +17962,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -15567,6 +17978,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15576,33 +17988,33 @@ Object { } `; -exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` +exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 28, + 25, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 28, + 25, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, - 27, + 24, ], "type": "ClassDeclaration", }, @@ -15612,8 +18024,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -15621,7 +18038,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -15639,7 +18056,7 @@ Object { "node": Object { "range": Array [ 7, - 27, + 24, ], "type": "ClassDeclaration", }, @@ -15661,7 +18078,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -15672,16 +18129,272 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "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 [ + 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": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.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 [ + 7, + 27, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + "U": Object { + "$ref": 3, + }, + }, + "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 [ + 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": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "U", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "U", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + ], + "name": "U", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, "variableMap": Object { "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -15721,7 +18434,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -15732,10 +18445,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -15803,6 +18517,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15910,6 +18625,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15970,6 +18686,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16015,6 +18732,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16030,6 +18748,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -16090,6 +18809,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16135,6 +18855,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16150,6 +18871,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -16210,6 +18932,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16255,6 +18978,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -16315,6 +19039,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -16375,6 +19100,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16386,7 +19112,7 @@ Object { exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16396,7 +19122,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16404,20 +19130,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 7, + 40, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "TestAlias": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "TestAlias", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 40, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "TestAlias", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + ], + "name": "TestAlias", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -16425,10 +19223,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -16436,7 +19235,7 @@ Object { exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16446,7 +19245,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16454,20 +19253,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 7, + 51, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "TestClassProps": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "TestClassProps", + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 51, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "TestClassProps", + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + }, + ], + "name": "TestClassProps", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -16475,10 +19346,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -16486,7 +19358,7 @@ Object { exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -16496,7 +19368,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16504,31 +19376,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 7, + 47, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 28, + 37, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "TestCallback": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "TestCallback", + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 47, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "TestCallback", + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + }, + ], + "name": "TestCallback", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -16536,7 +19511,7 @@ Object { exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -16546,7 +19521,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16556,7 +19531,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 10, @@ -16569,9 +19544,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "a", @@ -16583,26 +19558,31 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 4, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "a": Object { - "$ref": 3, + "$ref": 4, }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -16613,11 +19593,51 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, Object { "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 4, "defs": Array [ Object { "name": Object { @@ -16653,11 +19673,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -16669,7 +19689,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "obj", @@ -16694,8 +19714,9 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "obj": Object { @@ -16703,7 +19724,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -16753,7 +19774,7 @@ Object { }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -16764,10 +19785,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } @@ -16809,6 +19831,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -16866,6 +19889,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16936,6 +19960,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16981,6 +20006,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -17050,6 +20076,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -17139,6 +20166,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -17217,6 +20245,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -17277,6 +20306,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17342,6 +20372,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17420,6 +20451,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17480,6 +20512,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17525,6 +20558,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17642,6 +20676,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17702,6 +20737,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17747,6 +20783,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17864,6 +20901,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17924,6 +20962,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17935,7 +20974,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -17945,7 +20984,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -17955,7 +20994,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -17968,9 +21007,47 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 7, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, }, "identifier": Object { "name": "b", @@ -17982,26 +21059,31 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -18012,11 +21094,58 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, Object { "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 13, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 3, "defs": Array [ Object { "name": Object { @@ -18052,11 +21181,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -18067,8 +21196,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -18076,7 +21206,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { @@ -18116,7 +21246,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -18127,10 +21257,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [], } @@ -18138,7 +21269,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters-that-have-comments.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -18148,7 +21279,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -18158,7 +21289,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -18172,8 +21303,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "arguments": Object { @@ -18181,7 +21317,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -18192,7 +21328,47 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 30, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -18203,8 +21379,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "compare": Object { @@ -18212,7 +21389,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -18252,7 +21429,7 @@ Object { "name": "compare", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -18263,10 +21440,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -18274,7 +21452,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -18284,7 +21462,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -18294,7 +21472,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -18307,9 +21485,47 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 7, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, }, "identifier": Object { "name": "b", @@ -18321,26 +21537,31 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -18351,11 +21572,58 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, Object { "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 24, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 3, "defs": Array [ Object { "name": Object { @@ -18391,11 +21659,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -18406,8 +21674,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -18415,7 +21684,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { @@ -18455,7 +21724,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -18466,10 +21735,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [], } @@ -18531,6 +21801,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -18609,6 +21880,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -18669,6 +21941,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18680,7 +21953,7 @@ Object { exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -18690,7 +21963,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -18700,7 +21973,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -18715,7 +21988,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "age", @@ -18740,7 +22013,24 @@ Object { Object { "$id": 6, "from": Object { - "$ref": 7, + "$ref": 8, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, }, "identifier": Object { "name": "name", @@ -18757,10 +22047,15 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "age": Object { @@ -18777,7 +22072,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -18788,7 +22083,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -18828,11 +22123,11 @@ Object { "name": "name", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -18876,7 +22171,7 @@ Object { }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -18916,7 +22211,7 @@ Object { "name": "args", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -18925,10 +22220,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "message": Object { @@ -18936,7 +22236,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -18976,7 +22276,7 @@ Object { "name": "message", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -18985,12 +22285,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [], } @@ -19114,6 +22419,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -19244,6 +22550,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19279,6 +22586,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -19339,6 +22647,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19374,6 +22683,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -19434,6 +22744,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19445,7 +22756,7 @@ Object { exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19455,7 +22766,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19463,31 +22774,228 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], + }, + Object { + "$id": 5, + "block": Object { + "range": Array [ + 29, + 55, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Y", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + "B": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 29, + 55, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -19495,7 +23003,7 @@ Object { exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -19505,7 +23013,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19513,31 +23021,160 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "X": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -19545,7 +23182,7 @@ Object { exports[`typescript fixtures/basics/interface-extends.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19555,7 +23192,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19563,216 +23200,232 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "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": 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 [ + "throughReferences": 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 [], + "$ref": 1, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` +exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 269, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 269, + 35, ], "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, - }, + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "baz", + "$id": 3, + "block": Object { "range": Array [ - 75, - 78, + 0, + 34, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, }, - "identifier": Object { - "name": "loo", - "range": Array [ - 164, - 167, - ], - "type": "Identifier", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -19781,23 +23434,66 @@ Object { }, ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 34, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -19806,149 +23502,167 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "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, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 34, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 34, + 22, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], "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", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -19956,49 +23670,1354 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 1, + "$id": 21, "block": Object { "range": Array [ 0, - 22, + 269, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 20, "block": Object { "range": Array [ 0, - 22, + 269, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, + "childScopes": Array [ + Object { + "$id": 19, + "block": Object { + "range": Array [ + 0, + 267, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "bax", + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 143, + 144, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 146, + 147, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 149, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "loo", + "range": Array [ + 164, + 167, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 170, + 171, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 173, + 174, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 176, + 177, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 197, + 198, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 200, + 201, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 203, + 204, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 16, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 225, + 227, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 17, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 250, + 251, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 18, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 253, + 255, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": 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, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, + ], + "type": "interface", + "typeMap": Object { + "F": Object { + "$ref": 2, + }, + "J": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 20, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 20, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "J", + "range": Array [ + 194, + 195, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 193, + 196, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "J", + "range": Array [ + 194, + 195, + ], + "type": "Identifier", + }, + ], + "name": "J", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "F", + "range": Array [ + 247, + 248, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 246, + 249, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "F", + "range": Array [ + 247, + 248, + ], + "type": "Identifier", + }, + ], + "name": "F", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": 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, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, + ], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 21, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 20, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 267, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 20, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": 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, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 21, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.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": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "y", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "typeMap": Object { + "Test": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "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, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "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": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 33, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 33, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.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": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "J", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 36, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-generic.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 [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 17, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Test": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -20006,10 +25025,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -20017,7 +25037,7 @@ Object { exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -20027,7 +25047,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -20035,31 +25055,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 87, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Test": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 87, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -20067,7 +25190,7 @@ Object { exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, @@ -20077,7 +25200,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 7, "block": Object { "range": Array [ 0, @@ -20085,81 +25208,455 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 61, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 48, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 44, + 47, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "module", + "typeMap": Object { + "test": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 61, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-optional-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": 4, + "block": Object { + "range": Array [ + 0, + 81, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 59, + 71, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 73, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object { + "test": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 6, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 5, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 81, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "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 [ + "throughReferences": 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 [], + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } @@ -20167,7 +25664,7 @@ Object { exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -20177,7 +25674,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -20185,20 +25682,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "test": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -20206,10 +25775,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -20217,7 +25787,7 @@ Object { exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -20227,7 +25797,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -20235,31 +25805,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + 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": 1, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "x": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -20452,6 +26125,7 @@ Object { ], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 19, }, @@ -20787,6 +26461,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 20, }, @@ -21098,6 +26773,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21109,7 +26785,7 @@ Object { exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -21119,7 +26795,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -21130,11 +26806,74 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 17, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { "nestedArray": Object { @@ -21142,7 +26881,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -21188,7 +26927,7 @@ Object { "name": "nestedArray", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -21197,12 +26936,23 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } @@ -21210,7 +26960,7 @@ Object { exports[`typescript fixtures/basics/never-type-param.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -21220,7 +26970,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21235,7 +26985,24 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, }, "identifier": Object { "name": "Observable", @@ -21254,10 +27021,14 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -21265,7 +27036,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -21311,7 +27082,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -21324,12 +27095,16 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -21371,6 +27146,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -21412,6 +27188,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -21482,6 +27259,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21493,7 +27271,7 @@ Object { exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -21503,7 +27281,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -21513,7 +27291,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -21528,7 +27306,24 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 8, + "$ref": 9, + }, + "identifier": Object { + "name": "Entity", + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 9, }, "identifier": Object { "name": "validateEntity", @@ -21543,9 +27338,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { "name": "e", @@ -21562,9 +27357,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 7, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { "name": "s", @@ -21587,9 +27382,9 @@ Object { }, }, Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { "name": "e", @@ -21610,10 +27405,14 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "arguments": Object { @@ -21627,7 +27426,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -21638,7 +27437,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, Object { @@ -21678,14 +27477,14 @@ Object { "name": "e", "references": Array [ Object { - "$ref": 5, + "$ref": 6, }, Object { - "$ref": 7, + "$ref": 8, }, ], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, Object { @@ -21731,11 +27530,11 @@ Object { "name": "s", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -21748,10 +27547,14 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "processEntity": Object { @@ -21759,7 +27562,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -21799,7 +27602,7 @@ Object { "name": "processEntity", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -21812,12 +27615,16 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -21849,6 +27656,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -21964,6 +27772,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22054,6 +27863,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -22185,6 +27995,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -22245,6 +28056,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22290,6 +28102,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -22330,6 +28143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -22390,6 +28204,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -22450,6 +28265,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22461,7 +28277,7 @@ Object { exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, @@ -22471,7 +28287,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, @@ -22481,7 +28297,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 29, @@ -22495,8 +28311,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "arguments": Object { @@ -22504,7 +28325,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -22515,13 +28336,53 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 29, + 32, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, }, }, ], }, Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 68, @@ -22535,33 +28396,78 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "arguments": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 68, + 71, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, }, }, ], }, Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 109, @@ -22575,33 +28481,34 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "arguments": Object { - "$ref": 6, + "$ref": 8, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { - "$id": 6, + "$id": 8, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], }, Object { - "$id": 10, + "$id": 12, "block": Object { "range": Array [ 147, @@ -22615,34 +28522,35 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "arguments": Object { - "$ref": 8, + "$ref": 10, }, "x": Object { - "$ref": 9, + "$ref": 11, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 12, }, "variables": Array [ Object { - "$id": 8, + "$id": 10, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, Object { - "$id": 9, + "$id": 11, "defs": Array [ Object { "name": Object { @@ -22678,7 +28586,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, ], @@ -22690,7 +28598,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "foo", @@ -22715,8 +28623,9 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 14, }, "variableMap": Object { "foo": Object { @@ -22724,7 +28633,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 13, }, "variables": Array [ Object { @@ -22774,7 +28683,7 @@ Object { }, ], "scope": Object { - "$ref": 11, + "$ref": 13, }, }, ], @@ -22785,10 +28694,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, "variables": Array [], } @@ -22829,15 +28739,366 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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": 8, + "$ref": 12, }, "identifier": Object { "name": "one", "range": Array [ - 40, - 43, + 91, + 94, ], "type": "Identifier", }, @@ -22848,15 +29109,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 7, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "one", "range": Array [ - 52, - 55, + 114, + 117, ], "type": "Identifier", }, @@ -22867,15 +29128,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 8, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "one", "range": Array [ - 70, - 73, + 139, + 142, ], "type": "Identifier", }, @@ -22886,15 +29147,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 9, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "one", "range": Array [ - 88, - 91, + 150, + 153, ], "type": "Identifier", }, @@ -22905,15 +29166,34 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "one", "range": Array [ - 111, - 114, + 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", }, @@ -22926,8 +29206,9 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 13, }, "variableMap": Object { "arguments": Object { @@ -22938,7 +29219,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 12, }, "variables": Array [ Object { @@ -22949,7 +29230,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 12, }, }, Object { @@ -22959,15 +29240,15 @@ Object { "name": Object { "name": "one", "range": Array [ - 25, - 34, + 29, + 38, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 134, + 193, ], "type": "FunctionDeclaration", }, @@ -22980,8 +29261,8 @@ Object { Object { "name": "one", "range": Array [ - 25, - 34, + 29, + 38, ], "type": "Identifier", }, @@ -23003,9 +29284,21 @@ Object { Object { "$ref": 7, }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, ], "scope": Object { - "$ref": 8, + "$ref": 12, }, }, ], @@ -23016,16 +29309,17 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 14, }, "variableMap": Object { - "processOptional": Object { + "processOptionalCall": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 13, }, "variables": Array [ Object { @@ -23033,17 +29327,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptional", + "name": "processOptionalCall", "range": Array [ 9, - 24, + 28, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 134, + 193, ], "type": "FunctionDeclaration", }, @@ -23054,18 +29348,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptional", + "name": "processOptionalCall", "range": Array [ 9, - 24, + 28, ], "type": "Identifier", }, ], - "name": "processOptional", + "name": "processOptionalCall", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 13, }, }, ], @@ -23076,22 +29370,23 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 14, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/optional-chain-call.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-call-with-parens.src 1`] = ` Object { "$id": 14, "block": Object { "range": Array [ 0, - 194, + 218, ], "type": "Program", }, @@ -23101,7 +29396,7 @@ Object { "block": Object { "range": Array [ 0, - 194, + 218, ], "type": "Program", }, @@ -23111,7 +29406,7 @@ Object { "block": Object { "range": Array [ 0, - 193, + 217, ], "type": "FunctionDeclaration", }, @@ -23127,8 +29422,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 44, - 47, + 51, + 54, ], "type": "Identifier", }, @@ -23146,8 +29441,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 57, - 60, + 66, + 69, ], "type": "Identifier", }, @@ -23165,8 +29460,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 74, - 77, + 85, + 88, ], "type": "Identifier", }, @@ -23184,8 +29479,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 91, - 94, + 104, + 107, ], "type": "Identifier", }, @@ -23203,8 +29498,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 114, - 117, + 129, + 132, ], "type": "Identifier", }, @@ -23222,8 +29517,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 139, - 142, + 156, + 159, ], "type": "Identifier", }, @@ -23241,8 +29536,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 150, - 153, + 169, + 172, ], "type": "Identifier", }, @@ -23260,8 +29555,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 163, - 166, + 184, + 187, ], "type": "Identifier", }, @@ -23279,8 +29574,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 179, - 182, + 202, + 205, ], "type": "Identifier", }, @@ -23293,6 +29588,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -23326,15 +29622,15 @@ Object { "name": Object { "name": "one", "range": Array [ - 29, - 38, + 35, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 193, + 217, ], "type": "FunctionDeclaration", }, @@ -23347,8 +29643,8 @@ Object { Object { "name": "one", "range": Array [ - 29, - 38, + 35, + 44, ], "type": "Identifier", }, @@ -23395,11 +29691,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, "variableMap": Object { - "processOptionalCall": Object { + "processOptionalCallParens": Object { "$ref": 0, }, }, @@ -23412,17 +29709,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalCall", + "name": "processOptionalCallParens", "range": Array [ 9, - 28, + 34, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 193, + 217, ], "type": "FunctionDeclaration", }, @@ -23433,15 +29730,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalCall", + "name": "processOptionalCallParens", "range": Array [ 9, - 28, + 34, ], "type": "Identifier", }, ], - "name": "processOptionalCall", + "name": "processOptionalCallParens", "references": Array [], "scope": Object { "$ref": 13, @@ -23455,6 +29752,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23464,33 +29762,33 @@ Object { } `; -exports[`typescript fixtures/basics/optional-chain-call-with-parens.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-element-access.src 1`] = ` Object { - "$id": 14, + "$id": 11, "block": Object { "range": Array [ 0, - 218, + 142, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 13, + "$id": 10, "block": Object { "range": Array [ 0, - 218, + 142, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 12, + "$id": 9, "block": Object { "range": Array [ 0, - 217, + 141, ], "type": "FunctionDeclaration", }, @@ -23501,13 +29799,13 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 51, - 54, + 47, + 50, ], "type": "Identifier", }, @@ -23520,13 +29818,13 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 66, - 69, + 59, + 62, ], "type": "Identifier", }, @@ -23539,13 +29837,13 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 85, - 88, + 74, + 77, ], "type": "Identifier", }, @@ -23558,13 +29856,13 @@ Object { Object { "$id": 6, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 104, - 107, + 89, + 92, ], "type": "Identifier", }, @@ -23577,13 +29875,13 @@ Object { Object { "$id": 7, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 129, - 132, + 104, + 107, ], "type": "Identifier", }, @@ -23596,13 +29894,234 @@ Object { Object { "$id": 8, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 156, - 159, + 122, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", }, @@ -23613,15 +30132,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 4, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 169, - 172, + 68, + 71, ], "type": "Identifier", }, @@ -23632,15 +30151,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 5, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 184, - 187, + 85, + 88, ], "type": "Identifier", }, @@ -23651,15 +30170,53 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$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": 12, + "$ref": 9, }, "identifier": Object { "name": "one", "range": Array [ - 202, - 205, + 144, + 147, ], "type": "Identifier", }, @@ -23672,8 +30229,9 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 13, + "$ref": 10, }, "variableMap": Object { "arguments": Object { @@ -23684,7 +30242,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 9, }, "variables": Array [ Object { @@ -23695,7 +30253,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 9, }, }, Object { @@ -23705,15 +30263,15 @@ Object { "name": Object { "name": "one", "range": Array [ - 35, - 44, + 38, + 47, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 217, + 167, ], "type": "FunctionDeclaration", }, @@ -23726,8 +30284,8 @@ Object { Object { "name": "one", "range": Array [ - 35, - 44, + 38, + 47, ], "type": "Identifier", }, @@ -23752,18 +30310,9 @@ Object { Object { "$ref": 8, }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, ], "scope": Object { - "$ref": 12, + "$ref": 9, }, }, ], @@ -23774,16 +30323,17 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 14, + "$ref": 11, }, "variableMap": Object { - "processOptionalCallParens": Object { + "processOptionalElementParens": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [ Object { @@ -23791,17 +30341,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalCallParens", + "name": "processOptionalElementParens", "range": Array [ 9, - 34, + 37, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 217, + 167, ], "type": "FunctionDeclaration", }, @@ -23812,18 +30362,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalCallParens", + "name": "processOptionalElementParens", "range": Array [ 9, - 34, + 37, ], "type": "Identifier", }, ], - "name": "processOptionalCallParens", + "name": "processOptionalElementParens", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 10, }, }, ], @@ -23834,22 +30384,23 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 11, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/optional-chain-element-access.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-with-parens.src 1`] = ` Object { "$id": 11, "block": Object { "range": Array [ 0, - 142, + 182, ], "type": "Program", }, @@ -23859,7 +30410,7 @@ Object { "block": Object { "range": Array [ 0, - 142, + 182, ], "type": "Program", }, @@ -23869,7 +30420,7 @@ Object { "block": Object { "range": Array [ 0, - 141, + 181, ], "type": "FunctionDeclaration", }, @@ -23904,8 +30455,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 59, - 62, + 61, + 64, ], "type": "Identifier", }, @@ -23923,8 +30474,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 74, - 77, + 81, + 84, ], "type": "Identifier", }, @@ -23942,8 +30493,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 89, - 92, + 101, + 104, ], "type": "Identifier", }, @@ -23961,8 +30512,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 104, - 107, + 126, + 129, ], "type": "Identifier", }, @@ -23980,8 +30531,8 @@ Object { "identifier": Object { "name": "one", "range": Array [ - 122, - 125, + 152, + 155, ], "type": "Identifier", }, @@ -23994,6 +30545,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -24027,15 +30579,15 @@ Object { "name": Object { "name": "one", "range": Array [ - 32, - 41, + 31, + 40, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 141, + 181, ], "type": "FunctionDeclaration", }, @@ -24048,8 +30600,8 @@ Object { Object { "name": "one", "range": Array [ - 32, - 41, + 31, + 40, ], "type": "Identifier", }, @@ -24087,11 +30639,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, "variableMap": Object { - "processOptionalElement": Object { + "processOptionalParens": Object { "$ref": 0, }, }, @@ -24104,17 +30657,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalElement", + "name": "processOptionalParens", "range": Array [ 9, - 31, + 30, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 141, + 181, ], "type": "FunctionDeclaration", }, @@ -24125,15 +30678,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalElement", + "name": "processOptionalParens", "range": Array [ 9, - 31, + 30, ], "type": "Identifier", }, ], - "name": "processOptionalElement", + "name": "processOptionalParens", "references": Array [], "scope": Object { "$ref": 10, @@ -24147,6 +30700,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24156,33 +30710,85 @@ Object { } `; -exports[`typescript fixtures/basics/optional-chain-element-access-with-parens.src 1`] = ` +exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` Object { - "$id": 11, + "$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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/readonly-arrays.src 1`] = ` +Object { + "$id": 13, "block": Object { "range": Array [ 0, - 168, + 211, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 12, "block": Object { "range": Array [ 0, - 168, + 211, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 6, "block": Object { "range": Array [ 0, - 167, + 106, ], "type": "FunctionDeclaration", }, @@ -24193,32 +30799,30 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 9, + "$ref": 6, }, "identifier": Object { - "name": "one", + "name": "ReadonlyArray", "range": Array [ - 54, - 57, + 18, + 31, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { "$id": 4, "from": Object { - "$ref": 9, + "$ref": 6, }, "identifier": Object { - "name": "one", + "name": "arr", "range": Array [ - 68, - 71, + 45, + 48, ], "type": "Identifier", }, @@ -24231,13 +30835,13 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 9, + "$ref": 6, }, "identifier": Object { - "name": "one", + "name": "arr", "range": Array [ - 85, - 88, + 75, + 78, ], "type": "Identifier", }, @@ -24247,108 +30851,186 @@ Object { }, "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", + "$ref": 3, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "arr": 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, }, - "kind": "r", - "resolved": Object { - "$ref": 2, + }, + 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": 4, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, }, - "writeExpr": undefined, }, + ], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 108, + 210, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 9, + "$ref": 11, }, "identifier": Object { - "name": "one", + "name": "arr", "range": Array [ - 122, - 125, + 149, + 152, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 8, }, "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 9, + "$ref": 11, }, "identifier": Object { - "name": "one", + "name": "arr", "range": Array [ - 144, - 147, + 179, + 182, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 8, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 12, }, "variableMap": Object { "arguments": Object { - "$ref": 1, + "$ref": 7, }, - "one": Object { - "$ref": 2, + "arr": Object { + "$ref": 8, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 11, }, "variables": Array [ Object { - "$id": 1, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 11, }, }, Object { - "$id": 2, + "$id": 8, "defs": Array [ Object { "name": Object { - "name": "one", + "name": "arr", "range": Array [ - 38, - 47, + 121, + 143, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 167, + 108, + 210, ], "type": "FunctionDeclaration", }, @@ -24359,37 +31041,25 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "one", + "name": "arr", "range": Array [ - 38, - 47, + 121, + 143, ], "type": "Identifier", }, ], - "name": "one", + "name": "arr", "references": Array [ Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, + "$ref": 9, }, Object { - "$ref": 8, + "$ref": 10, }, ], "scope": Object { - "$ref": 9, + "$ref": 11, }, }, ], @@ -24398,18 +31068,23 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { - "processOptionalElementParens": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 12, }, "variables": Array [ Object { @@ -24417,17 +31092,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalElementParens", + "name": "foo", "range": Array [ 9, - 37, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 167, + 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", }, @@ -24438,18 +31132,26 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalElementParens", + "name": "foo", "range": Array [ 9, - 37, + 12, + ], + "type": "Identifier", + }, + Object { + "name": "foo", + "range": Array [ + 117, + 120, ], "type": "Identifier", }, ], - "name": "processOptionalElementParens", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, ], @@ -24458,137 +31160,83 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 13, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/optional-chain-with-parens.src 1`] = ` +exports[`typescript fixtures/basics/readonly-tuples.src 1`] = ` Object { - "$id": 11, + "$id": 8, "block": Object { "range": Array [ 0, - 182, + 119, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 7, "block": Object { "range": Array [ 0, - 182, + 119, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 6, "block": Object { "range": Array [ 0, - 181, + 118, ], "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, - }, + "isStrict": true, + "references": Array [ Object { - "$id": 6, + "$id": 3, "from": Object { - "$ref": 9, + "$ref": 6, }, "identifier": Object { - "name": "one", + "name": "console", "range": Array [ - 101, - 104, + 50, + 57, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 4, "from": Object { - "$ref": 9, + "$ref": 6, }, "identifier": Object { - "name": "one", + "name": "pair", "range": Array [ - 126, - 129, + 62, + 66, ], "type": "Identifier", }, @@ -24599,15 +31247,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 5, "from": Object { - "$ref": 9, + "$ref": 6, }, "identifier": Object { - "name": "one", + "name": "pair", "range": Array [ - 152, - 155, + 84, + 88, ], "type": "Identifier", }, @@ -24618,21 +31266,26 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 7, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, - "one": Object { + "pair": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 6, }, "variables": Array [ Object { @@ -24643,7 +31296,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 6, }, }, Object { @@ -24651,17 +31304,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "one", + "name": "pair", "range": Array [ - 31, - 40, + 13, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 181, + 118, ], "type": "FunctionDeclaration", }, @@ -24672,37 +31325,25 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "one", + "name": "pair", "range": Array [ - 31, - 40, + 13, + 44, ], "type": "Identifier", }, ], - "name": "one", + "name": "pair", "references": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 4, }, Object { "$ref": 5, }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, ], "scope": Object { - "$ref": 9, + "$ref": 6, }, }, ], @@ -24711,18 +31352,23 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 8, }, "variableMap": Object { - "processOptionalParens": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 7, }, "variables": Array [ Object { @@ -24730,17 +31376,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalParens", + "name": "foo", "range": Array [ 9, - 30, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 181, + 118, ], "type": "FunctionDeclaration", }, @@ -24751,18 +31397,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalParens", + "name": "foo", "range": Array [ 9, - 30, + 12, ], "type": "Identifier", }, ], - "name": "processOptionalParens", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 7, }, }, ], @@ -24771,94 +31417,49 @@ Object { "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 [ + "throughReferences": 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 [], + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/readonly-arrays.src 1`] = ` +exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` Object { - "$id": 12, + "$id": 6, "block": Object { "range": Array [ 0, - 211, + 42, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 5, "block": Object { "range": Array [ 0, - 211, + 42, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, - 106, + 42, ], "type": "FunctionDeclaration", }, @@ -24869,57 +31470,41 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { - "name": "arr", + "name": "Map", "range": Array [ - 45, - 48, + 19, + 22, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ 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, + "$ref": 3, }, ], - "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 5, }, "variableMap": Object { + "abc": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, - "arr": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -24930,7 +31515,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, Object { @@ -24938,17 +31523,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "arr", + "name": "abc", "range": Array [ - 13, - 39, + 14, + 38, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 106, + 42, ], "type": "FunctionDeclaration", }, @@ -24959,154 +31544,259 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "arr", + "name": "abc", "range": Array [ - 13, - 39, + 14, + 38, ], "type": "Identifier", }, ], - "name": "arr", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "name": "abc", + "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 10, + "$ref": 3, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "test": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "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": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, "block": Object { "range": Array [ - 108, - 210, + 0, + 37, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 2, "from": Object { - "$ref": 10, + "$ref": 5, }, "identifier": Object { - "name": "arr", + "name": "Success", "range": Array [ - 149, - 152, + 17, + 24, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 7, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 3, "from": Object { - "$ref": 10, + "$ref": 5, }, "identifier": Object { - "name": "arr", + "name": "T", "range": Array [ - 179, - 182, + 25, + 26, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 7, + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Failure", + "range": Array [ + 30, + 37, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, + "throughReferences": Array [ + Object { + "$ref": 2, }, - "arr": Object { - "$ref": 7, + Object { + "$ref": 4, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 6, }, "variables": Array [ Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 7, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "arr", + "name": "T", "range": Array [ - 121, - 143, + 12, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ - 108, - 210, + 11, + 14, ], - "type": "FunctionDeclaration", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "Parameter", + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "arr", + "name": "T", "range": Array [ - 121, - 143, + 12, + 13, ], "type": "Identifier", }, ], - "name": "arr", + "name": "T", "references": Array [ Object { - "$ref": 8, - }, - Object { - "$ref": 9, + "$ref": 3, }, ], "scope": Object { - "$ref": 10, + "$ref": 5, }, }, ], @@ -25115,18 +31805,26 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], "type": "module", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "foo": Object { + "typeMap": Object { + "Result": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 6, }, "variables": Array [ Object { @@ -25134,66 +31832,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Result", "range": Array [ - 9, - 12, + 5, + 11, ], "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, + 37, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - Object { - "name": "foo", - "range": Array [ - 117, - 120, + "name": "Result", + "range": Array [ + 5, + 11, ], "type": "Identifier", }, ], - "name": "foo", + "name": "Result", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 6, }, }, ], @@ -25202,61 +31873,69 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/readonly-tuples.src 1`] = ` +exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 119, + 48, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, - 119, + 48, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, - 118, + 48, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { - "name": "console", + "name": "Success", "range": Array [ - 50, - 57, + 28, + 35, ], "type": "Identifier", }, @@ -25265,121 +31944,106 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { - "name": "pair", + "name": "T", "range": Array [ - 62, - 66, + 36, + 37, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 1, }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { - "name": "pair", + "name": "Failure", "range": Array [ - 84, - 88, + 41, + 48, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 2, + }, + Object { + "$ref": 4, }, ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { + "type": "type-alias", + "typeMap": Object { + "T": Object { "$ref": 1, }, - "pair": Object { - "$ref": 2, - }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "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", + "name": "T", "range": Array [ + 12, 13, - 44, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 118, + 11, + 25, ], - "type": "FunctionDeclaration", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "Parameter", + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "pair", + "name": "T", "range": Array [ + 12, 13, - 44, ], "type": "Identifier", }, ], - "name": "pair", + "name": "T", "references": Array [ Object { - "$ref": 4, - }, - Object { - "$ref": 5, + "$ref": 3, }, ], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -25390,60 +32054,64 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 2, + }, + Object { + "$ref": 4, }, ], "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "foo": Object { + "typeMap": Object { + "Result": Object { "$ref": 0, }, }, - "variableScope": Object { + "upperScope": Object { "$ref": 7, }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, "variables": Array [ Object { "$id": 0, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Result", "range": Array [ - 9, - 12, + 5, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 118, + 48, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Result", "range": Array [ - 9, - 12, + 5, + 11, ], "type": "Identifier", }, ], - "name": "foo", + "name": "Result", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -25454,122 +32122,68 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 2, + }, + Object { + "$ref": 4, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 42, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 42, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 42, + 30, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "abc": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -25577,16 +32191,17 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "test": Object { + "typeMap": Object { + "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { @@ -25594,39 +32209,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "test", + "name": "foo", "range": Array [ - 9, - 13, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 42, + 30, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "test", + "name": "foo", "range": Array [ - 9, - 13, + 5, + 8, ], "type": "Identifier", }, ], - "name": "test", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -25637,160 +32252,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "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-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, + "$ref": 3, }, "variables": Array [], } @@ -25798,7 +32264,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-in-arrow-function.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -25808,7 +32274,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -25818,7 +32284,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 21, @@ -25829,11 +32295,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "x": Object { @@ -25841,7 +32330,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -25881,7 +32370,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -25893,7 +32382,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "assertString", @@ -25916,10 +32405,15 @@ Object { }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "assertString": Object { @@ -25927,7 +32421,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -25977,7 +32471,7 @@ Object { }, ], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -25986,12 +32480,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -25999,7 +32498,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-in-function.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -26009,7 +32508,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -26019,7 +32518,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -26030,11 +32529,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "arguments": Object { @@ -26045,7 +32567,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -26056,7 +32578,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, Object { @@ -26096,7 +32618,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -26105,10 +32627,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "assertsString": Object { @@ -26116,7 +32643,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -26156,7 +32683,7 @@ Object { "name": "assertsString", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -26165,12 +32692,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -26178,7 +32710,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-in-interface.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -26188,7 +32720,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -26196,31 +32728,160 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 60, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "node", + "range": Array [ + 33, + 42, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "node", + "range": Array [ + 53, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "AssertFoo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "AssertFoo", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 60, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AssertFoo", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + ], + "name": "AssertFoo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -26272,6 +32933,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26312,6 +32974,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26327,6 +32990,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -26387,6 +33051,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -26447,6 +33112,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26458,7 +33124,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-with-guard-in-arrow-function.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -26468,7 +33134,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -26478,7 +33144,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 21, @@ -26489,11 +33155,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "x": Object { @@ -26501,7 +33190,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -26541,7 +33230,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -26553,7 +33242,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "assertString", @@ -26576,10 +33265,15 @@ Object { }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "assertString": Object { @@ -26587,7 +33281,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -26637,7 +33331,7 @@ Object { }, ], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -26646,12 +33340,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -26659,7 +33358,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-with-guard-in-function.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -26669,7 +33368,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -26679,7 +33378,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -26690,11 +33389,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "arguments": Object { @@ -26705,7 +33427,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -26716,7 +33438,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, Object { @@ -26756,7 +33478,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -26765,10 +33487,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "assertsStringGuard": Object { @@ -26776,7 +33503,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -26816,7 +33543,7 @@ Object { "name": "assertsStringGuard", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -26825,12 +33552,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -26838,7 +33570,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-with-guard-in-interface.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -26848,7 +33580,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -26856,31 +33588,160 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "node", + "range": Array [ + 33, + 42, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "node", + "range": Array [ + 53, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "AssertFoo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "AssertFoo", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 70, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AssertFoo", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + ], + "name": "AssertFoo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -26932,6 +33793,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26972,6 +33834,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26987,6 +33850,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27047,6 +33911,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27107,6 +33972,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27118,7 +33984,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-arrow-function.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -27128,7 +33994,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -27138,7 +34004,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 17, @@ -27153,7 +34019,24 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, }, "identifier": Object { "name": "x", @@ -27170,10 +34053,15 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "x": Object { @@ -27181,7 +34069,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -27221,11 +34109,11 @@ Object { "name": "x", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -27237,7 +34125,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "isString", @@ -27260,10 +34148,15 @@ Object { }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "isString": Object { @@ -27271,7 +34164,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -27321,7 +34214,7 @@ Object { }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -27330,12 +34223,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -27343,7 +34241,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-function.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -27353,7 +34251,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -27363,7 +34261,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -27378,7 +34276,24 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, }, "identifier": Object { "name": "x", @@ -27395,10 +34310,15 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "arguments": Object { @@ -27409,7 +34329,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -27420,7 +34340,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, Object { @@ -27460,11 +34380,11 @@ Object { "name": "x", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -27473,10 +34393,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "isString": Object { @@ -27484,7 +34409,183 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, + }, + "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": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-guard-in-interface.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": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "node", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "node", + "range": Array [ + 39, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, }, "variables": Array [ Object { @@ -27492,39 +34593,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "isString", + "name": "Foo", "range": Array [ - 9, - 17, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 75, + 56, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "isString", + "name": "Foo", "range": Array [ - 9, - 17, + 10, + 13, ], "type": "Identifier", }, ], - "name": "isString", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -27533,62 +34634,20 @@ Object { "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 [ + "throughReferences": 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 [], + "$ref": 1, + }, + Object { + "$ref": 2, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -27664,6 +34723,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27728,6 +34788,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27743,6 +34804,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -27810,6 +34872,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -27870,6 +34933,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27881,7 +34945,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` Object { - "$id": 8, + "$id": 12, "block": Object { "range": Array [ 0, @@ -27891,7 +34955,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 11, "block": Object { "range": Array [ 0, @@ -27901,7 +34965,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 44, @@ -27915,33 +34979,78 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "A": Object { + "$ref": 5, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 11, }, "variableMap": Object { "arguments": Object { - "$ref": 3, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { - "$id": 3, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 56, + 81, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 6, }, }, ], }, Object { - "$id": 6, + "$id": 10, "block": Object { "range": Array [ 88, @@ -27952,30 +35061,97 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 126, + 129, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 9, + }, + ], "type": "function", + "typeMap": Object { + "A": Object { + "$ref": 8, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 11, }, "variableMap": Object { "arguments": Object { - "$ref": 5, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 10, }, "variables": Array [ Object { - "$id": 5, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 10, + }, + }, + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 100, + 131, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 10, }, }, ], @@ -27987,7 +35163,24 @@ Object { Object { "$id": 2, "from": Object { - "$ref": 7, + "$ref": 11, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 11, }, "identifier": Object { "name": "foo", @@ -28006,10 +35199,17 @@ Object { Object { "$ref": 2, }, + Object { + "$ref": 3, + }, + Object { + "$ref": 9, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 12, }, "variableMap": Object { "bar": Object { @@ -28020,7 +35220,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 11, }, "variables": Array [ Object { @@ -28060,7 +35260,7 @@ Object { "name": "bar", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 11, }, }, Object { @@ -28100,7 +35300,7 @@ Object { "name": "baz", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 11, }, }, ], @@ -28113,12 +35313,19 @@ Object { Object { "$ref": 2, }, + Object { + "$ref": 3, + }, + Object { + "$ref": 9, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 12, }, "variables": Array [], } @@ -28126,7 +35333,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 9, + "$id": 23, "block": Object { "range": Array [ 0, @@ -28136,7 +35343,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 22, "block": Object { "range": Array [ 0, @@ -28146,7 +35353,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, @@ -28157,128 +35364,500 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 7, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 7, + }, + }, "upperScope": Object { - "$ref": 8, + "$ref": 22, + }, + "variableMap": Object { + "foo": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 22, + }, + "variables": Array [ + Object { + "$id": 6, + "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": 9, + }, + }, + Object { + "$id": 7, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 34, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + Object { + "$id": 13, + "block": Object { + "range": Array [ + 75, + 164, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 149, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 11, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 11, + }, + }, + "upperScope": Object { + "$ref": 22, + }, + "variableMap": Object { + "foo2": Object { + "$ref": 10, + }, + }, + "variableScope": Object { + "$ref": 22, + }, + "variables": Array [ + Object { + "$id": 10, + "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": 13, + }, + }, + Object { + "$id": 11, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 86, + 124, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + ], + }, + Object { + "$id": 17, + "block": Object { + "range": Array [ + 165, + 244, + ], + "type": "TSInterfaceDeclaration", }, - "variableMap": Object { - "foo": Object { - "$ref": 4, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 15, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "bar2", + "range": Array [ + 212, + 216, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 16, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 229, + 230, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 14, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 15, + }, + ], + "type": "interface", + "typeMap": Object { + "A": Object { + "$ref": 14, }, }, + "upperScope": Object { + "$ref": 22, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 22, }, "variables": Array [ Object { - "$id": 4, + "$id": 14, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "A", "range": Array [ - 6, - 9, + 191, + 192, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 74, + 179, + 203, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "A", "range": Array [ - 6, - 9, + 191, + 192, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 16, + }, + ], "scope": Object { - "$ref": 5, + "$ref": 17, }, }, ], }, Object { - "$id": 7, + "$id": 21, "block": Object { "range": Array [ - 75, - 164, + 245, + 338, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "foo2": Object { - "$ref": 6, + "references": Array [ + Object { + "$id": 19, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 307, + 310, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 20, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 323, + 324, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 18, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 19, + }, + ], + "type": "interface", + "typeMap": Object { + "A": Object { + "$ref": 18, }, }, + "upperScope": Object { + "$ref": 22, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 22, }, "variables": Array [ Object { - "$id": 6, + "$id": 18, "defs": Array [ Object { "name": Object { - "name": "foo2", + "name": "A", "range": Array [ - 81, - 85, + 272, + 273, ], "type": "Identifier", }, "node": Object { "range": Array [ - 75, - 164, + 260, + 298, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo2", + "name": "A", "range": Array [ - 81, - 85, + 272, + 273, ], "type": "Identifier", }, ], - "name": "foo2", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 20, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 21, }, }, ], @@ -28288,9 +35867,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 22, }, "identifier": Object { "name": "bar", @@ -28305,9 +35884,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 22, }, "identifier": Object { "name": "bar", @@ -28324,15 +35903,23 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, Object { - "$ref": 3, + "$ref": 5, }, ], "type": "module", + "typeMap": Object { + "bar": Object { + "$ref": 2, + }, + "bar2": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 9, + "$ref": 23, }, "variableMap": Object { "foo": Object { @@ -28343,7 +35930,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 22, }, "variables": Array [ Object { @@ -28383,7 +35970,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 22, }, }, Object { @@ -28423,7 +36010,95 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 22, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 175, + 178, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 165, + 244, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 175, + 178, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [ + Object { + "$ref": 19, + }, + ], + "scope": Object { + "$ref": 22, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "bar2", + "range": Array [ + 255, + 259, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 245, + 338, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar2", + "range": Array [ + 255, + 259, + ], + "type": "Identifier", + }, + ], + "name": "bar2", + "references": Array [ + Object { + "$ref": 15, + }, + ], + "scope": Object { + "$ref": 22, }, }, ], @@ -28434,17 +36109,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, Object { - "$ref": 3, + "$ref": 5, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 23, }, "variables": Array [], } @@ -28452,7 +36128,7 @@ Object { exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -28462,7 +36138,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -28472,7 +36148,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28483,11 +36159,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "interop", + "range": Array [ + 36, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "AudioBufferList": Object { @@ -28495,7 +36194,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -28535,7 +36234,7 @@ Object { "name": "AudioBufferList", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -28544,10 +36243,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "AudioBufferList": Object { @@ -28555,7 +36259,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -28595,7 +36299,7 @@ Object { "name": "AudioBufferList", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -28604,12 +36308,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -28617,7 +36326,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28627,7 +36336,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28635,20 +36344,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28656,10 +36437,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -28667,7 +36449,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28677,7 +36459,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28685,20 +36467,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28706,10 +36560,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -28717,7 +36572,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28727,7 +36582,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28735,20 +36590,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28756,10 +36683,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -28767,7 +36695,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28777,7 +36705,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28785,20 +36713,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28806,10 +36806,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -28817,7 +36818,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28827,7 +36828,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28835,20 +36836,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28856,10 +36929,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -28867,7 +36941,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28877,7 +36951,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28885,20 +36959,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28906,10 +37052,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -28917,7 +37064,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28927,7 +37074,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28935,20 +37082,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28956,10 +37175,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -28967,7 +37187,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28977,7 +37197,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28985,20 +37205,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29006,10 +37298,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -29017,7 +37310,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29027,7 +37320,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29035,20 +37328,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29056,10 +37421,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -29067,7 +37433,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29077,7 +37443,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29085,20 +37451,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29106,10 +37544,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -29117,7 +37556,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29127,7 +37566,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29135,20 +37574,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 20, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29156,10 +37667,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -29167,7 +37679,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29177,7 +37689,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29185,20 +37697,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29206,10 +37790,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -29217,7 +37802,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29227,7 +37812,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29235,20 +37820,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29256,10 +37913,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -29267,7 +37925,7 @@ Object { exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, @@ -29277,7 +37935,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 7, "block": Object { "range": Array [ 0, @@ -29285,31 +37943,250 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 43, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 7, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 57, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } @@ -29317,7 +38194,7 @@ Object { exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -29327,7 +38204,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -29335,31 +38212,212 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 89, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "onclick", + "range": Array [ + 40, + 79, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "this", + "range": Array [ + 50, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 62, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Event", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object { + "UIElement": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "UIElement", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 89, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "UIElement", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + ], + "name": "UIElement", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -29367,7 +38425,7 @@ Object { exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29377,7 +38435,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29385,20 +38443,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 23, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 23, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29406,10 +38536,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -29441,6 +38572,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -29507,6 +38639,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29542,6 +38675,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29706,6 +38840,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29717,7 +38852,7 @@ Object { exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29727,7 +38862,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29738,11 +38873,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "foo": Object { @@ -29750,7 +38908,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -29796,7 +38954,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -29805,12 +38963,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -29893,6 +39056,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30016,6 +39180,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30051,6 +39216,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -30117,6 +39283,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30162,6 +39329,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30222,6 +39390,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30282,6 +39451,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30327,6 +39497,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30387,6 +39558,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30447,6 +39619,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30492,6 +39665,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30595,6 +39769,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30655,6 +39830,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30700,6 +39876,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -30715,6 +39892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30775,6 +39953,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30786,7 +39965,7 @@ Object { exports[`typescript fixtures/declare/interface.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -30796,7 +39975,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -30804,20 +39983,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "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": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -30825,10 +40076,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -30870,6 +40122,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -30885,6 +40138,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30945,6 +40199,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30990,6 +40245,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31005,6 +40261,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -31065,6 +40322,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31076,7 +40334,7 @@ Object { exports[`typescript fixtures/declare/type-alias.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -31086,7 +40344,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -31094,20 +40352,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -31115,10 +40445,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -31150,6 +40481,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31216,6 +40548,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31271,6 +40604,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31324,6 +40658,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31388,6 +40723,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -31452,6 +40788,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31507,6 +40844,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31560,6 +40898,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31624,6 +40963,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -31688,6 +41028,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31743,6 +41084,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31796,6 +41138,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31860,6 +41203,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -31924,6 +41268,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31999,6 +41344,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -32099,6 +41445,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -32163,6 +41510,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -32227,6 +41575,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32272,6 +41621,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -32354,6 +41704,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32418,6 +41769,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32463,6 +41815,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -32545,6 +41898,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32609,6 +41963,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32664,6 +42019,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32717,6 +42073,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32781,6 +42138,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -32845,6 +42203,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32900,6 +42259,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32953,6 +42313,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33017,6 +42378,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33081,6 +42443,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33136,6 +42499,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33189,6 +42553,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33253,6 +42618,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33317,6 +42683,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33372,6 +42739,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33425,6 +42793,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33489,6 +42858,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33553,6 +42923,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33630,6 +43001,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33708,6 +43080,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33772,6 +43145,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -33836,6 +43210,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33847,7 +43222,7 @@ Object { exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -33857,7 +43232,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -33867,7 +43242,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -33877,7 +43252,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 31, @@ -33892,7 +43267,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Inject", @@ -33909,7 +43284,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "APP_CONFIG", @@ -33926,7 +43301,24 @@ Object { Object { "$id": 6, "from": Object { - "$ref": 7, + "$ref": 8, + }, + "identifier": Object { + "name": "AppConfig", + "range": Array [ + 60, + 69, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, }, "identifier": Object { "name": "config", @@ -33950,10 +43342,14 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -33964,7 +43360,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -33975,7 +43371,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -34015,11 +43411,11 @@ Object { "name": "config", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -34035,10 +43431,14 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "Service": Object { @@ -34046,7 +43446,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -34086,7 +43486,7 @@ Object { "name": "Service", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -34102,10 +43502,14 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "Service": Object { @@ -34113,7 +43517,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -34153,7 +43557,7 @@ Object { "name": "Service", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -34169,12 +43573,16 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -34248,6 +43656,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -34326,6 +43735,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34390,6 +43800,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -34454,6 +43865,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34531,6 +43943,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -34609,6 +44022,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34673,6 +44087,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -34737,6 +44152,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34833,6 +44249,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34915,6 +44332,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -34979,6 +44397,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -35043,6 +44462,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35139,6 +44559,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -35221,6 +44642,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -35285,6 +44707,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -35349,6 +44772,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35426,6 +44850,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -35504,6 +44929,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -35568,6 +44994,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -35632,6 +45059,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35709,6 +45137,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -35787,6 +45216,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -35851,6 +45281,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -35915,6 +45346,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36022,6 +45454,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36092,6 +45525,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -36162,6 +45596,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36249,6 +45684,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -36316,6 +45752,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36383,6 +45820,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36470,6 +45908,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -36537,6 +45976,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36604,6 +46044,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36691,6 +46132,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -36758,6 +46200,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36825,6 +46268,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36870,6 +46314,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -36930,6 +46375,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -36990,6 +46436,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37001,7 +46448,7 @@ Object { exports[`typescript fixtures/errorRecovery/class-empty-extends-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -37011,7 +46458,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -37021,7 +46468,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37032,11 +46479,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -37044,7 +46514,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -37084,7 +46554,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -37093,10 +46563,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -37104,7 +46579,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -37144,7 +46619,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -37153,12 +46628,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -37200,6 +46680,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -37282,6 +46763,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -37346,6 +46828,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37357,7 +46840,7 @@ Object { exports[`typescript fixtures/errorRecovery/class-multiple-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -37367,7 +46850,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -37377,7 +46860,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37388,11 +46871,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "a": Object { @@ -37400,7 +46906,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -37440,7 +46946,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -37449,10 +46955,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "a": Object { @@ -37460,7 +46971,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -37500,7 +47011,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -37509,12 +47020,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -37556,6 +47072,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -37571,6 +47088,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -37631,6 +47149,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37676,6 +47195,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -37707,6 +47227,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -37767,6 +47288,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37778,7 +47300,7 @@ Object { exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37788,7 +47310,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37796,20 +47318,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "M": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "M", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 22, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "M", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + ], + "name": "M", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -37817,10 +47411,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -37878,6 +47473,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -37948,6 +47544,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37959,7 +47556,7 @@ Object { exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37969,7 +47566,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37980,11 +47577,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "foo": Object { @@ -37992,7 +47612,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -38038,7 +47658,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -38047,12 +47667,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -38106,6 +47731,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38125,6 +47751,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38182,6 +47809,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38201,6 +47829,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38246,6 +47875,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38277,6 +47907,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38337,6 +47968,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38382,6 +48014,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38413,6 +48046,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38473,6 +48107,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38528,6 +48163,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38559,6 +48195,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -38619,6 +48256,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -38679,6 +48317,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38724,6 +48363,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38781,6 +48421,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -38851,6 +48492,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38906,6 +48548,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38937,6 +48580,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -38997,6 +48641,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -39057,6 +48702,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39068,7 +48714,7 @@ Object { exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39078,7 +48724,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -39086,20 +48732,461 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/interface-empty-extends.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 [ + 0, + 26, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39107,22 +49194,23 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 72, + 28, ], "type": "Program", }, @@ -39132,7 +49220,7 @@ Object { "block": Object { "range": Array [ 0, - 72, + 28, ], "type": "Program", }, @@ -39141,17 +49229,18 @@ Object { "$id": 1, "block": Object { "range": Array [ - 7, - 72, + 0, + 27, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "enum", + "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39167,14 +49256,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "X": Object { + "typeMap": Object { + "d": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -39184,36 +49274,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "d", "range": Array [ - 68, - 69, + 10, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 72, + 0, + 27, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "d", "range": Array [ - 68, - 69, + 10, + 11, ], "type": "Identifier", }, ], - "name": "X", + "name": "d", "references": Array [], "scope": Object { "$ref": 2, @@ -39227,6 +49317,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39236,40 +49327,112 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 49, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 49, + 51, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39277,49 +49440,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 27, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 27, + 52, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39327,49 +49563,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 28, + 54, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 28, + 54, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 52, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 52, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39377,18 +49686,19 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39398,7 +49708,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -39406,20 +49716,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39427,49 +49809,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 52, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 52, + 51, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39477,168 +49932,478 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 54, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 54, + 52, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 29, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 51, + 53, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 51, + 53, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 51, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 30, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 51, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-protected.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 51, + 53, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 51, + 53, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 51, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 30, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 51, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -39648,7 +50413,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39656,220 +50421,730 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 29, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-readonly.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 53, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 53, + 51, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 29, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-protected.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 53, + 50, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 53, + 50, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 27, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 52, + 41, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, - 52, + 41, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 40, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-readonly.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 51, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 51, + 39, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39877,49 +51152,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 50, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 50, + 40, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 38, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39927,49 +51275,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 41, + 42, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 41, + 42, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 40, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39977,49 +51398,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 39, + 41, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 39, + 41, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 39, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -40027,49 +51521,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-static.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 40, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 40, + 39, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -40077,49 +51644,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-with-default-value.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 42, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 42, + 39, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 38, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -40127,49 +51767,124 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` +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, + "$id": 3, "block": Object { "range": Array [ 0, - 41, + 44, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 41, + 44, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 43, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 43, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -40177,47 +51892,77 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-static.src 1`] = ` +exports[`typescript fixtures/errorRecovery/object-assertion-not-allowed.src 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 39, + 12, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, - 39, + 12, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, "variables": Array [], }, @@ -40225,49 +51970,83 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-with-default-value.src 1`] = ` +exports[`typescript fixtures/errorRecovery/object-optional-not-allowed.src 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 39, + 12, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, - 39, + 12, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, "variables": Array [], }, @@ -40275,26 +52054,29 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-with-no-body.src 1`] = `"'{' expected."`; - -exports[`typescript fixtures/errorRecovery/interface-with-optional-index-signature.src 1`] = ` +exports[`typescript fixtures/errorRecovery/solo-const.src 1`] = ` Object { "$id": 1, "block": Object { "range": Array [ 0, - 44, + 5, ], "type": "Program", }, @@ -40304,7 +52086,7 @@ Object { "block": Object { "range": Array [ 0, - 44, + 5, ], "type": "Program", }, @@ -40314,6 +52096,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -40329,6 +52112,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40338,23 +52122,23 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/object-assertion-not-allowed.src 1`] = ` +exports[`typescript fixtures/expressions/call-expression-type-arguments.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 12, + 24, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 12, + 24, ], "type": "Program", }, @@ -40365,39 +52149,74 @@ Object { Object { "$id": 0, "from": Object { - "$ref": 1, + "$ref": 3, }, "identifier": Object { - "name": "a", + "name": "A", "range": Array [ - 2, + 4, + 5, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 0, 3, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": null, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 8, 10, + 13, ], - "type": "ObjectExpression", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], "throughReferences": Array [ Object { "$ref": 0, }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -40409,34 +52228,41 @@ Object { Object { "$ref": 0, }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/object-optional-not-allowed.src 1`] = ` +exports[`typescript fixtures/expressions/new-expression-type-arguments.src 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 12, + 21, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 12, + 21, ], "type": "Program", }, @@ -40445,43 +52271,138 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 4, }, "identifier": Object { "name": "a", "range": Array [ - 2, - 3, + 6, + 7, ], "type": "Identifier", }, "kind": "w", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": Object { "range": Array [ - 8, 10, + 20, ], - "type": "ObjectExpression", + "type": "NewExpression", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, + }, + "variableMap": Object { + "a": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, - "variables": Array [], + "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": 4, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -40489,51 +52410,118 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/solo-const.src 1`] = ` +exports[`typescript fixtures/expressions/optional-call-expression-type-arguments.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 5, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 5, + 35, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, "variables": Array [], }, @@ -40541,24 +52529,35 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/expressions/call-expression-type-arguments.src 1`] = ` +exports[`typescript fixtures/expressions/tagged-template-expression-type-arguments.src 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 24, + 14, ], "type": "Program", }, @@ -40568,7 +52567,7 @@ Object { "block": Object { "range": Array [ 0, - 24, + 14, ], "type": "Program", }, @@ -40599,10 +52598,10 @@ Object { "$ref": 2, }, "identifier": Object { - "name": "foo", + "name": "bar", "range": Array [ - 10, - 13, + 4, + 7, ], "type": "Identifier", }, @@ -40620,6 +52619,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -40642,6 +52642,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40651,89 +52652,344 @@ Object { } `; -exports[`typescript fixtures/expressions/new-expression-type-arguments.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 21, + 57, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 21, + 57, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", + "block": Object { "range": Array [ - 6, - 7, + 30, + 56, ], - "type": "Identifier", + "type": "TSModuleBlock", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, }, - "writeExpr": Object { + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "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": 7, + "block": Object { + "range": Array [ + 0, + 84, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 84, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { "range": Array [ - 10, - 20, + 21, + 84, ], - "type": "NewExpression", + "type": "TSModuleBlock", }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 32, + 82, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Selection", + "range": Array [ + 67, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "empty-function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "selector": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "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": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "block", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, }, - "identifier": Object { - "name": "A", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", + "variableMap": Object { + "select": Object { + "$ref": 1, + }, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "variableScope": Object { + "$ref": 6, + }, + "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": 5, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { - "a": Object { + "d3": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -40741,49 +52997,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "d3", "range": Array [ - 6, - 7, + 18, + 20, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 21, + 84, ], - "type": "VariableDeclaration", + "type": "TSModuleDeclaration", }, - "type": "Variable", + "parent": null, + "type": "NamespaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "d3", "range": Array [ - 6, - 7, + 18, + 20, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "d3", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -40794,172 +53040,103 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/expressions/optional-call-expression-type-arguments.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/global-module-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 35, + 92, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, - 35, + 92, ], "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, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { - "$ref": 1, + "$id": 2, + "block": Object { + "range": Array [ + 43, + 51, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], }, - ], - "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, + "$id": 3, "block": Object { "range": Array [ - 0, - 14, + 81, + 89, ], - "type": "Program", + "type": "TSModuleBlock", }, "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", + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], }, @@ -40967,67 +53144,322 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "global": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, - "variables": Array [], + "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/ambient-module-declaration-with-import.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` Object { - "$id": 3, + "$id": 11, "block": Object { "range": Array [ 0, - 57, + 114, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 10, "block": Object { "range": Array [ 0, - 57, + 114, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ - 30, - 56, + 13, + 112, ], "type": "TSModuleBlock", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 34, + 73, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 58, + 66, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "typeMap": Object {}, + "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 [], + "throughReferences": Array [], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "C": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "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 [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + Object { + "$id": 8, + "block": Object { + "range": Array [ + 93, + 110, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 7, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 10, }, "variableMap": Object { - "fs": Object { + "C": Object { "$ref": 0, }, + "bar": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [ Object { @@ -41035,45 +53467,79 @@ Object { "defs": Array [ Object { "name": Object { - "name": "fs", + "name": "C", "range": Array [ + 40, 41, - 43, ], "type": "Identifier", }, "node": Object { "range": Array [ - 41, - 43, + 34, + 73, ], - "type": "ImportDefaultSpecifier", + "type": "ClassDeclaration", }, - "parent": Object { + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "bar", "range": Array [ - 34, - 54, + 102, + 105, ], - "type": "ImportDeclaration", + "type": "Identifier", }, - "type": "ImportBinding", + "node": Object { + "range": Array [ + 93, + 110, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "fs", + "name": "bar", "range": Array [ - 41, - 43, + 102, + 105, ], "type": "Identifier", }, ], - "name": "fs", + "name": "bar", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 9, }, }, ], @@ -41084,12 +53550,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [], }, @@ -41099,111 +53566,337 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 11, }, "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` Object { - "$id": 6, + "$id": 16, "block": Object { "range": Array [ 0, - 84, + 231, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 15, "block": Object { "range": Array [ 0, - 84, + 231, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 14, "block": Object { "range": Array [ - 21, - 84, + 9, + 231, ], "type": "TSModuleBlock", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 10, "block": Object { "range": Array [ - 32, - 82, + 56, + 135, ], - "type": "TSDeclareFunction", + "type": "ClassDeclaration", }, - "childScopes": Array [], + "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", + "typeMap": Object {}, + "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": "empty-function", + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 14, }, "variableMap": Object { - "selector": Object { - "$ref": 2, + "Point": Object { + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 15, }, "variables": Array [ Object { - "$id": 2, + "$id": 5, "defs": Array [ Object { "name": Object { - "name": "selector", + "name": "Point", "range": Array [ - 48, - 64, + 62, + 67, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 82, + 56, + 135, ], - "type": "TSDeclareFunction", + "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": 13, + "block": Object { + "range": Array [ + 156, + 229, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [ + Object { + "$id": 12, + "block": Object { + "range": Array [ + 173, + 223, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "typeMap": Object { + "Id": Object { + "$ref": 11, + }, + }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 11, + "defs": Array [ + Object { + "name": Object { + "name": "Id", + "range": Array [ + 183, + 185, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 173, + 223, + ], + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "Parameter", + "type": "InterfaceName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "selector", + "name": "Id", "range": Array [ - 48, - 64, + 183, + 185, ], "type": "Identifier", }, ], - "name": "selector", + "name": "Id", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 13, }, }, ], @@ -41211,59 +53904,133 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 14, + }, + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 15, }, "variableMap": Object { - "select": Object { - "$ref": 1, + "B": Object { + "$ref": 3, + }, + "Point": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 15, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "select", + "name": "Point", "range": Array [ - 41, - 47, + 62, + 67, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 82, + 56, + 135, ], - "type": "TSDeclareFunction", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "select", + "name": "Point", "range": Array [ - 41, - 47, + 62, + 67, ], "type": "Identifier", }, ], - "name": "select", + "name": "Point", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 14, + }, + }, + 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": 14, }, }, ], @@ -41274,16 +54041,20 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 16, }, "variableMap": Object { - "d3": Object { + "A": Object { "$ref": 0, }, + "x": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 5, + "$ref": 15, }, "variables": Array [ Object { @@ -41291,17 +54062,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "d3", + "name": "A", "range": Array [ - 18, - 20, + 7, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 84, + 231, ], "type": "TSModuleDeclaration", }, @@ -41312,18 +54083,68 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "d3", + "name": "A", "range": Array [ - 18, - 20, + 7, + 8, ], "type": "Identifier", }, ], - "name": "d3", + "name": "A", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 15, + }, + }, + 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": 15, }, }, ], @@ -41334,32 +54155,33 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 16, }, "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/global-module-declaration.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = ` Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, - 92, + 33, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, - 92, + 33, ], "type": "Program", }, @@ -41369,60 +54191,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "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, + "$ref": 0, }, "variables": Array [], }, @@ -41432,367 +54207,416 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "global": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 1, }, - "variables": Array [ + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/array-type.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 2, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", - }, - "node": Object { + "$id": 1, + "block": Object { "range": Array [ - 21, - 51, + 0, + 19, ], - "type": "TSModuleDeclaration", + "type": "TSTypeAliasDeclaration", }, - "parent": null, - "type": "NamespaceName", - }, - Object { - "name": Object { - "name": "global", - "range": Array [ - 74, - 80, - ], - "type": "Identifier", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, }, - "node": Object { - "range": Array [ - 56, - 89, - ], - "type": "TSModuleDeclaration", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, }, - "parent": null, - "type": "NamespaceName", + "variables": Array [], }, ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ Object { - "name": "global", - "range": Array [ - 74, - 80, + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, }, ], - "name": "global", - "references": Array [], - "scope": Object { - "$ref": 4, - }, }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` +exports[`typescript fixtures/types/conditional.src 1`] = ` Object { - "$id": 10, + "$id": 2, "block": Object { "range": Array [ 0, - 114, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 1, "block": Object { "range": Array [ 0, - 114, + 49, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 8, - "block": Object { - "range": Array [ - 13, - 112, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 5, - "block": Object { + "name": Object { + "name": "x", "range": Array [ - 34, - 73, + 4, + 47, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "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, - }, - }, - ], - }, + "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, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/conditional-infer.src 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, }, - "variableMap": Object { - "C": Object { - "$ref": 2, - }, + "identifier": Object { + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 9, + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "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, - }, - }, - ], + "writeExpr": undefined, }, Object { - "$id": 7, - "block": Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", "range": Array [ - 93, - 110, + 35, + 36, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, + "identifier": Object { + "name": "U", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 7, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], + "identifier": Object { + "name": "T", + "range": Array [ + 46, + 47, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "C": Object { - "$ref": 0, + "throughReferences": Array [ + Object { + "$ref": 3, }, - "bar": Object { + Object { + "$ref": 4, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "T", "range": Array [ - 40, - 41, + 13, + 14, ], "type": "Identifier", }, "node": Object { "range": Array [ - 34, - 73, + 12, + 15, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "T", "range": Array [ - 40, - 41, + 13, + 14, ], "type": "Identifier", }, ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ + "name": "T", + "references": Array [ Object { - "name": Object { - "name": "bar", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 93, - 110, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", + "$ref": 2, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "bar", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", + "$ref": 5, }, ], - "name": "bar", - "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 6, }, }, ], @@ -41801,412 +54625,411 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object { + "Element": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Element", + "range": Array [ + 5, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Element", + "range": Array [ + 5, + 12, + ], + "type": "Identifier", + }, + ], + "name": "Element", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` +exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` Object { - "$id": 14, + "$id": 15, "block": Object { "range": Array [ 0, - 231, + 127, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 13, + "$id": 14, "block": Object { "range": Array [ 0, - 231, + 127, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 12, + "$id": 13, "block": Object { "range": Array [ - 9, - 231, + 0, + 126, ], - "type": "TSModuleBlock", + "type": "TSTypeAliasDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 10, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 56, - 135, + 21, + 22, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "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, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 13, }, - "variableMap": Object { - "Point": Object { - "$ref": 5, - }, + "identifier": Object { + "name": "U", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", }, - "variableScope": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": 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, - }, - }, - ], + "identifier": Object { + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, Object { - "$id": 11, - "block": Object { + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 156, - 229, + 69, + 70, ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 12, + "type": "Identifier", }, - "variableMap": Object {}, - "variableScope": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { "$ref": 13, }, - "variables": Array [], + "identifier": Object { + "name": "U", + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 4, + "$id": 8, "from": Object { - "$ref": 12, + "$ref": 13, }, "identifier": Object { - "name": "x", + "name": "T", "range": Array [ - 27, - 28, + 83, + 84, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { "$ref": 1, }, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "Promise", "range": Array [ - 31, - 44, + 93, + 100, ], - "type": "Literal", + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 107, + 108, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 124, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, }, + "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 3, + }, Object { "$ref": 4, }, - ], - "type": "block", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "B": Object { - "$ref": 3, + Object { + "$ref": 6, }, - "Point": Object { - "$ref": 2, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 14, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 14, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "Point", + "name": "T", "range": Array [ - 62, - 67, + 14, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ - 56, - 135, + 13, + 16, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Point", + "name": "T", "range": Array [ - 62, - 67, + 14, + 15, ], "type": "Identifier", }, ], - "name": "Point", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 3, - "defs": Array [ + "name": "T", + "references": Array [ Object { - "name": Object { - "name": "B", - "range": Array [ - 154, - 155, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 147, - 229, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", + "$ref": 2, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "B", - "range": Array [ - 154, - 155, - ], - "type": "Identifier", + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 12, }, ], - "name": "B", - "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 13, }, }, ], @@ -42215,21 +55038,41 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], "type": "module", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "A": Object { + "typeMap": Object { + "Unpacked": Object { "$ref": 0, }, - "x": Object { - "$ref": 1, - }, }, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 14, }, "variables": Array [ Object { @@ -42237,89 +55080,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "Unpacked", "range": Array [ - 7, - 8, + 5, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 231, + 126, ], - "type": "TSModuleDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "NamespaceName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "Unpacked", "range": Array [ - 7, - 8, + 5, + 13, ], "type": "Identifier", }, ], - "name": "A", + "name": "Unpacked", "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, + "$ref": 14, }, }, ], @@ -42328,153 +55121,243 @@ Object { "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 [ + "throughReferences": 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 [], + "$ref": 3, }, - ], - "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 [], + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 15, }, "variables": Array [], } `; -exports[`typescript fixtures/types/conditional.src 1`] = ` +exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` Object { - "$id": 2, + "$id": 8, "block": Object { "range": Array [ 0, - 49, + 64, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, - 49, + 64, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 63, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 8, + 11, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [ Object { @@ -42482,45 +55365,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "Foo", "range": Array [ - 4, - 47, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 48, + 63, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "Foo", "range": Array [ - 4, - 47, + 5, + 8, ], "type": "Identifier", }, ], - "name": "x", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 7, }, }, ], @@ -42529,162 +55406,23 @@ Object { "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 [ + "throughReferences": 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 [], + "$ref": 3, }, - ], - "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 [], + "$ref": 4, }, - ], - "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 [], + "$ref": 5, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } @@ -42716,6 +55454,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42782,6 +55521,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42793,7 +55533,7 @@ Object { exports[`typescript fixtures/types/constructor.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -42803,7 +55543,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -42814,11 +55554,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "f": Object { @@ -42826,7 +55609,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -42872,54 +55655,127 @@ Object { "name": "f", "references": Array [], "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/constructor-generic.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 [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { "$ref": 1, }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, }, ], - }, - ], - "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", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { "f": Object { @@ -42927,7 +55783,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -42973,7 +55829,54 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 5, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 11, + 14, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, }, }, ], @@ -42982,12 +55885,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } @@ -42995,7 +55903,7 @@ Object { exports[`typescript fixtures/types/constructor-in-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43005,7 +55913,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43016,11 +55924,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -43028,7 +55959,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43074,7 +56005,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43083,12 +56014,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43096,7 +56032,7 @@ Object { exports[`typescript fixtures/types/constructor-with-rest.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43106,7 +56042,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43117,11 +56053,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -43129,7 +56088,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43175,7 +56134,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43184,12 +56143,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43197,7 +56161,7 @@ Object { exports[`typescript fixtures/types/function.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43207,7 +56171,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43218,11 +56182,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 8, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "f": Object { @@ -43230,7 +56237,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -43276,7 +56283,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -43285,12 +56292,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -43298,7 +56313,7 @@ Object { exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, @@ -43308,7 +56323,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -43319,11 +56334,76 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 11, + 15, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { "f": Object { @@ -43331,7 +56411,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -43377,7 +56457,54 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 5, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 10, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, }, }, ], @@ -43386,12 +56513,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } @@ -43399,7 +56531,7 @@ Object { exports[`typescript fixtures/types/function-in-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43409,7 +56541,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43420,11 +56552,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -43432,7 +56587,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43478,7 +56633,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43487,12 +56642,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43500,7 +56660,7 @@ Object { exports[`typescript fixtures/types/function-with-array-destruction.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43510,7 +56670,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43518,31 +56678,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "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": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -43550,7 +56813,7 @@ Object { exports[`typescript fixtures/types/function-with-object-destruction.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43560,7 +56823,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43568,31 +56831,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "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": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -43600,7 +56966,7 @@ Object { exports[`typescript fixtures/types/function-with-rest.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43610,7 +56976,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43621,11 +56987,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -43633,7 +57022,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43679,7 +57068,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43688,12 +57077,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43701,7 +57095,7 @@ Object { exports[`typescript fixtures/types/function-with-this.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43711,7 +57105,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43722,11 +57116,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "this", + "range": Array [ + 8, + 20, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -43734,7 +57151,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43780,7 +57197,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43789,12 +57206,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43802,7 +57224,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43812,7 +57234,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43820,20 +57242,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -43841,10 +57335,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -43852,7 +57347,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43862,7 +57357,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43870,20 +57365,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -43891,10 +57458,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -43902,7 +57470,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43912,7 +57480,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43920,20 +57488,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -43941,10 +57581,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -43952,7 +57593,7 @@ Object { exports[`typescript fixtures/types/indexed.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43962,7 +57603,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43973,11 +57614,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "K", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -43985,7 +57669,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -44031,7 +57715,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -44040,12 +57724,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -44053,7 +57745,7 @@ Object { exports[`typescript fixtures/types/intersection-type.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -44063,7 +57755,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -44071,20 +57763,210 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "LinkedList", + "range": Array [ + 33, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "LinkedList": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + ], + "name": "LinkedList", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -44092,10 +57974,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -44127,6 +58010,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -44193,6 +58077,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44228,6 +58113,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -44294,6 +58180,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44329,6 +58216,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -44395,6 +58283,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44406,7 +58295,7 @@ Object { exports[`typescript fixtures/types/mapped.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44416,7 +58305,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44427,11 +58316,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44439,7 +58351,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44485,7 +58397,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44494,12 +58406,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44507,7 +58424,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44517,7 +58434,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44528,11 +58445,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44540,7 +58480,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44586,7 +58526,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44595,12 +58535,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44608,7 +58553,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly-minus.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44618,7 +58563,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44629,11 +58574,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44641,7 +58609,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44687,7 +58655,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44696,12 +58664,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44709,7 +58682,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly-plus.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44719,7 +58692,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44730,11 +58703,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44742,7 +58738,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44788,7 +58784,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44797,12 +58793,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44810,7 +58811,7 @@ Object { exports[`typescript fixtures/types/mapped-untypped.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44820,7 +58821,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44831,11 +58832,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44843,7 +58867,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44889,7 +58913,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44898,12 +58922,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44911,7 +58940,7 @@ Object { exports[`typescript fixtures/types/nested-types.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44921,7 +58950,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44929,20 +58958,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -44950,10 +59051,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -44961,7 +59063,7 @@ Object { exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44971,7 +59073,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44979,20 +59081,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "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": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -45000,10 +59174,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -45011,7 +59186,7 @@ Object { exports[`typescript fixtures/types/reference.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45021,7 +59196,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45032,11 +59207,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -45044,7 +59242,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -45090,7 +59288,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -45099,12 +59297,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45112,7 +59315,7 @@ Object { exports[`typescript fixtures/types/reference-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45122,7 +59325,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45133,11 +59336,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -45145,7 +59371,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -45191,7 +59417,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -45200,12 +59426,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45213,7 +59444,7 @@ Object { exports[`typescript fixtures/types/reference-generic-nested.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -45223,7 +59454,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45234,11 +59465,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 13, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -45246,7 +59520,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -45292,7 +59566,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -45301,12 +59575,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -45358,6 +59640,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -45389,6 +59672,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -45449,6 +59733,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -45509,6 +59794,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45520,7 +59806,7 @@ Object { exports[`typescript fixtures/types/this-type-expanded.src 1`] = ` Object { - "$id": 24, + "$id": 28, "block": Object { "range": Array [ 0, @@ -45530,7 +59816,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 23, + "$id": 27, "block": Object { "range": Array [ 0, @@ -45540,7 +59826,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 22, + "$id": 26, "block": Object { "range": Array [ 0, @@ -45564,8 +59850,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { @@ -45590,7 +59877,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 109, @@ -45601,11 +59888,36 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 116, + 117, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { @@ -45613,7 +59925,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -45624,13 +59936,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], }, Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 167, @@ -45640,7 +59952,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 203, @@ -45654,12 +59966,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], }, @@ -45668,9 +59981,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "fn", @@ -45682,7 +59995,7 @@ Object { }, "kind": "w", "resolved": Object { - "$ref": 7, + "$ref": 8, }, "writeExpr": Object { "range": Array [ @@ -45693,9 +60006,9 @@ Object { }, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "fn", @@ -45707,41 +60020,42 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 7, + "$ref": 8, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { - "$ref": 6, + "$ref": 7, }, "fn": Object { - "$ref": 7, + "$ref": 8, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { - "$id": 6, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, Object { - "$id": 7, + "$id": 8, "defs": Array [ Object { "name": Object { @@ -45783,20 +60097,20 @@ Object { "name": "fn", "references": Array [ Object { - "$ref": 8, + "$ref": 9, }, Object { - "$ref": 9, + "$ref": 10, }, ], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, ], }, Object { - "$id": 17, + "$id": 19, "block": Object { "range": Array [ 255, @@ -45806,7 +60120,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 18, "block": Object { "range": Array [ 288, @@ -45820,12 +60134,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 17, + "$ref": 19, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 18, }, "variables": Array [], }, @@ -45834,9 +60149,28 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 14, + "$id": 15, "from": Object { - "$ref": 17, + "$ref": 19, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 262, + 263, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 16, + "from": Object { + "$ref": 19, }, "identifier": Object { "name": "fn", @@ -45848,7 +60182,7 @@ Object { }, "kind": "w", "resolved": Object { - "$ref": 13, + "$ref": 14, }, "writeExpr": Object { "range": Array [ @@ -45859,9 +60193,9 @@ Object { }, }, Object { - "$id": 15, + "$id": 17, "from": Object { - "$ref": 17, + "$ref": 19, }, "identifier": Object { "name": "fn", @@ -45873,41 +60207,46 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 13, + "$ref": 14, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 15, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { - "$ref": 12, + "$ref": 13, }, "fn": Object { - "$ref": 13, + "$ref": 14, }, }, "variableScope": Object { - "$ref": 17, + "$ref": 19, }, "variables": Array [ Object { - "$id": 12, + "$id": 13, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 19, }, }, Object { - "$id": 13, + "$id": 14, "defs": Array [ Object { "name": Object { @@ -45949,20 +60288,20 @@ Object { "name": "fn", "references": Array [ Object { - "$ref": 14, + "$ref": 16, }, Object { - "$ref": 15, + "$ref": 17, }, ], "scope": Object { - "$ref": 17, + "$ref": 19, }, }, ], }, Object { - "$id": 19, + "$id": 22, "block": Object { "range": Array [ 345, @@ -45973,36 +60312,61 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 21, + "from": Object { + "$ref": 22, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 352, + 353, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 21, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { - "$ref": 18, + "$ref": 20, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 22, }, "variables": Array [ Object { - "$id": 18, + "$id": 20, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 22, }, }, ], }, Object { - "$id": 21, + "$id": 25, "block": Object { "range": Array [ 404, @@ -46013,30 +60377,55 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 24, + "from": Object { + "$ref": 25, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 411, + 412, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 24, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { - "$ref": 20, + "$ref": 23, }, }, "variableScope": Object { - "$ref": 21, + "$ref": 25, }, "variables": Array [ Object { - "$id": 20, + "$id": 23, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 25, }, }, ], @@ -46047,8 +60436,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 23, + "$ref": 27, }, "variableMap": Object { "A": Object { @@ -46056,7 +60446,7 @@ Object { }, }, "variableScope": Object { - "$ref": 23, + "$ref": 27, }, "variables": Array [ Object { @@ -46094,9 +60484,22 @@ Object { }, ], "name": "A", - "references": Array [], + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 21, + }, + Object { + "$ref": 24, + }, + ], "scope": Object { - "$ref": 22, + "$ref": 26, }, }, ], @@ -46107,8 +60510,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 24, + "$ref": 28, }, "variableMap": Object { "A": Object { @@ -46116,7 +60520,7 @@ Object { }, }, "variableScope": Object { - "$ref": 23, + "$ref": 27, }, "variables": Array [ Object { @@ -46156,7 +60560,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 23, + "$ref": 27, }, }, ], @@ -46167,10 +60571,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 24, + "$ref": 28, }, "variables": Array [], } @@ -46202,6 +60607,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46268,6 +60674,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46303,6 +60710,110 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "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", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46323,21 +60834,21 @@ Object { "name": "x", "range": Array [ 4, - 9, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 9, + 44, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 10, + 44, ], "type": "VariableDeclaration", }, @@ -46350,7 +60861,7 @@ Object { "name": "x", "range": Array [ 4, - 9, + 44, ], "type": "Identifier", }, @@ -46369,6 +60880,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46378,13 +60890,13 @@ Object { } `; -exports[`typescript fixtures/types/tuple-optional.src 1`] = ` +exports[`typescript fixtures/types/tuple-rest.src 1`] = ` Object { "$id": 2, "block": Object { "range": Array [ 0, - 45, + 29, ], "type": "Program", }, @@ -46394,7 +60906,7 @@ Object { "block": Object { "range": Array [ 0, - 45, + 29, ], "type": "Program", }, @@ -46404,6 +60916,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46424,21 +60937,21 @@ Object { "name": "x", "range": Array [ 4, - 44, + 28, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 44, + 28, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 44, + 28, ], "type": "VariableDeclaration", }, @@ -46451,7 +60964,7 @@ Object { "name": "x", "range": Array [ 4, - 44, + 28, ], "type": "Identifier", }, @@ -46470,6 +60983,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46479,9 +60993,9 @@ Object { } `; -exports[`typescript fixtures/types/tuple-rest.src 1`] = ` +exports[`typescript fixtures/types/tuple-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -46491,7 +61005,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -46499,22 +61013,49 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "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": 2, - }, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -46522,45 +61063,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "Foo", "range": Array [ - 4, - 28, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, 28, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "Foo", "range": Array [ - 4, - 28, + 5, + 8, ], "type": "Identifier", }, ], - "name": "x", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -46571,60 +61106,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "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, + "$ref": 3, }, "variables": Array [], } @@ -46656,6 +61142,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46722,6 +61209,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46733,7 +61221,7 @@ Object { exports[`typescript fixtures/types/type-operator.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -46743,7 +61231,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -46754,11 +61242,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -46769,7 +61280,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -46815,7 +61326,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, Object { @@ -46861,7 +61372,7 @@ Object { "name": "y", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -46870,12 +61381,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -46929,6 +61445,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46999,6 +61516,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47034,6 +61552,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -47247,6 +61766,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47258,7 +61778,7 @@ Object { exports[`typescript fixtures/types/union-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -47268,7 +61788,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -47276,20 +61796,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -47297,10 +61889,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts index 3def6a382deb..3c2d819ba228 100644 --- a/packages/parser/tests/tools/scope-analysis.ts +++ b/packages/parser/tests/tools/scope-analysis.ts @@ -4,6 +4,7 @@ import { AST_NODE_TYPES, } from '@typescript-eslint/experimental-utils'; import { ScopeManager } from '../../src/scope/scope-manager'; +import { Scope } from '../../src/scope/scopes'; /** Reference resolver. */ export class ReferenceResolver { @@ -114,6 +115,19 @@ export function referenceToJSON( }); } +function mapToJSON( + data: Map, + resolver: ReferenceResolver, +): Record { + return Array.from(data.entries()).reduce>( + (map, [name, variable]) => { + map[name] = resolver.ref(variable); + return map; + }, + {}, + ); +} + /** * Convert a given scope object to JSON object. * @param scope The eslint-scope's scope object. @@ -121,23 +135,21 @@ export function referenceToJSON( * @returns {Object} The object that can be used for JSON.stringify. */ export function scopeToJSON( - scope: TSESLintScope.Scope, + scope: 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 variableMap = mapToJSON(scope.set, resolver); + const typeMap = mapToJSON(scope.setTypes, resolver); 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)); + const childScopes = scope.childScopes.map(c => + scopeToJSON(c as Scope, resolver), + ); return resolver.resolve(scope, { type, @@ -147,6 +159,7 @@ export function scopeToJSON( variables, references, variableMap, + typeMap, throughReferences, variableScope, upperScope,