From c47f8d08393bd0b3f06ef2485b26f75947477379 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 12 Feb 2019 21:49:19 +0100 Subject: [PATCH 01/12] feat(parser): update scope-analysis part 1 --- .../eslint-plugin/src/rules/no-unused-vars.ts | 31 +- .../tests/rules/no-unused-vars.test.ts | 238 +- .../tests/rules/no-use-before-define.test.ts | 16 + .../src/ts-eslint-scope/Referencer.ts | 7 +- .../src/ts-eslint-scope/Scope.ts | 4 +- .../src/ts-eslint-scope/ScopeManager.ts | 2 +- packages/parser/src/analyze-scope.ts | 223 +- packages/parser/src/scope/TypeDefinition.ts | 26 + packages/parser/src/scope/scope-manager.ts | 27 +- packages/parser/src/scope/scopes.ts | 52 +- packages/parser/src/scope/typeReferencing.ts | 38 + .../class-with-type-extends-default.ts | 1 + .../scope-analysis/empty-body-function.ts | 1 + .../scope-analysis/mixed-variable-ref.ts | 2 + .../parameter-property-simple.ts | 8 + .../scope-analysis/parameter-property.ts | 8 + .../fixtures/scope-analysis/typed-this.src.ts | 1 + .../lib/__snapshots__/scope-analysis.ts.snap | 36217 ++++++++------ .../tests/lib/__snapshots__/tsx.ts.snap | 136 +- .../lib/__snapshots__/typescript.ts.snap | 38878 +++++++++++----- 20 files changed, 49856 insertions(+), 26060 deletions(-) create mode 100644 packages/parser/src/scope/TypeDefinition.ts create mode 100644 packages/parser/src/scope/typeReferencing.ts create mode 100644 packages/parser/tests/fixtures/scope-analysis/class-with-type-extends-default.ts create mode 100644 packages/parser/tests/fixtures/scope-analysis/empty-body-function.ts create mode 100644 packages/parser/tests/fixtures/scope-analysis/mixed-variable-ref.ts create mode 100644 packages/parser/tests/fixtures/scope-analysis/parameter-property-simple.ts create mode 100644 packages/parser/tests/fixtures/scope-analysis/parameter-property.ts create mode 100644 packages/parser/tests/fixtures/scope-analysis/typed-this.src.ts 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/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index 45bb8c80db15..5113ba3fdb38 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,126 @@ 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 defined but never used.", + line: 3, + column: 10, + }, + ]), + }, + { + 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 defined but never used.", + line: 3, + column: 7, + }, + { + message: "'bar' is defined but never used.", + line: 4, + column: 7, + }, + ]), + }, + { + 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..c13baec5b041 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 @@ -951,5 +951,21 @@ enum Foo { }, ], }, + // types + { + code: ` +var x: Foo = 2; +type Foo = string | number + `, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { + name: 'Foo', + }, + type: AST_NODE_TYPES.Identifier, + }, + ], + }, ], }); diff --git a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts b/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts index 6169d9def9a5..69e20949467d 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts @@ -33,7 +33,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, 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..58728146e5c9 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts @@ -31,7 +31,7 @@ interface ScopeManager { isStrictModeSupported(): boolean; // Returns appropriate scope for this node. - __get(node: TSESTree.Node): Scope | undefined; + __get(node: TSESTree.Node): Scope[] | undefined; getDeclaredVariables(node: TSESTree.Node): Variable[]; acquire(node: TSESTree.Node, inner?: boolean): Scope | null; acquireAll(node: TSESTree.Node): Scope | null; diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 4e680373d774..c6bbd2956dd3 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -6,8 +6,10 @@ 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'; /** * Define the override function of `Scope#__define` for global augmentation. @@ -44,6 +46,16 @@ class PatternVisitor extends TSESLintScope.PatternVisitor { 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) { @@ -90,6 +102,17 @@ class PatternVisitor extends TSESLintScope.PatternVisitor { 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); + } + } } class Referencer extends TSESLintScope.Referencer { @@ -233,6 +256,9 @@ class Referencer extends TSESLintScope.Referencer { const upperTypeMode = this.typeMode; this.typeMode = true; + if (node.typeParameters) { + this.visit(node.typeParameters); + } if (node.superTypeParameters) { this.visit(node.superTypeParameters); } @@ -276,9 +302,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) { + typeReferencing(currentScope, node); + } else { super.Identifier(node); } @@ -455,7 +485,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(); + + this.visit(node.typeParameters); + + if (node.id) { + scope.__define( + node.id, + new TypeDefinition('InterfaceName', node.id, node, null, null, null), + ); + } + + scopeManager.__nestInterfaceScope(node); + + if (node.extends) { + node.extends.forEach(this.visit, this); + } + + this.visit(node.body); + this.close(node); + + this.typeMode = upperTypeMode; } /** @@ -521,7 +575,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().__define( + pattern, + new TypeDefinition('TypeParameter', pattern, node, null, i), + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + }, + ); + } } /** @@ -642,21 +712,7 @@ class Referencer extends TSESLintScope.Referencer { * @param node The TSPropertySignature node to visit. */ TSPropertySignature(node: TSESTree.TSPropertySignature): void { - const upperTypeMode = this.typeMode; - const { computed, key, typeAnnotation, initializer } = node; - - if (computed) { - this.typeMode = false; - this.visit(key); - this.typeMode = true; - } else { - this.typeMode = true; - this.visit(key); - } - this.visit(typeAnnotation); - this.visit(initializer); - - this.typeMode = upperTypeMode; + this.visitTypeProperty(node); } /** @@ -664,22 +720,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,8 +831,36 @@ class Referencer extends TSESLintScope.Referencer { } TSTypeAliasDeclaration(node: TSESTree.TSTypeAliasDeclaration): void { + const scopeManager = this.scopeManager; + const scope = this.currentScope(); this.typeMode = true; - this.visitChildren(node); + + if (node.id && node.id.type === AST_NODE_TYPES.Identifier) { + scope.__define( + 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 = false; } @@ -790,6 +877,7 @@ class Referencer extends TSESLintScope.Referencer { TSAbstractClassProperty(node: TSESTree.TSAbstractClassProperty): void { this.ClassProperty(node); } + TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void { this.MethodDefinition(node); } @@ -863,6 +951,77 @@ 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; + } + + visitTypeProperty(node: TSESTree.TSPropertySignature): void { + const upperTypeMode = this.typeMode; + + if (node.computed) { + this.visit(node.key); + } + + this.visit(node.typeAnnotation); + this.visit(node.initializer); + + 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/scope-manager.ts b/packages/parser/src/scope/scope-manager.ts index c179bd512d3d..5c0f69c2964d 100644 --- a/packages/parser/src/scope/scope-manager.ts +++ b/packages/parser/src/scope/scope-manager.ts @@ -1,5 +1,10 @@ import { TSESTree, TSESLintScope } from '@typescript-eslint/experimental-utils'; -import { EmptyFunctionScope, EnumScope } from './scopes'; +import { + EmptyFunctionScope, + EnumScope, + InterfaceScope, + TypeAliasScope, +} from './scopes'; /** * based on eslint-scope @@ -25,4 +30,24 @@ export class ScopeManager extends TSESLintScope.ScopeManager { new EmptyFunctionScope(this, this.__currentScope, node), ); } + + /** @internal */ + __nestInterfaceScope( + node: TSESTree.TSInterfaceDeclaration, + ): TSESLintScope.Scope { + return this.__nestScope( + new InterfaceScope(this, this.__currentScope, node), + ); + } + + /** @internal */ + __nestTypeAliasScope( + node: TSESTree.TSTypeAliasDeclaration, + ): TSESLintScope.Scope { + return this.__nestScope( + new TypeAliasScope(this, this.__currentScope, node), + ); + } + + // TODO: override __nest**Scope methods with new scope classes } diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index 4ddaa297d535..3ccdd576c511 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -1,8 +1,34 @@ import { TSESTree, TSESLintScope } from '@typescript-eslint/experimental-utils'; import { ScopeManager } from './scope-manager'; +export class Scope extends TSESLintScope.Scope { + /** @internal */ + __resolve(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; + } + 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; + } +} + /** The scope class for enum. */ -export class EnumScope extends TSESLintScope.Scope { +export class EnumScope extends Scope { constructor( scopeManager: ScopeManager, upperScope: TSESLintScope.Scope, @@ -13,7 +39,7 @@ 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, @@ -22,3 +48,25 @@ export class EmptyFunctionScope extends TSESLintScope.Scope { super(scopeManager, 'empty-function', upperScope, block, false); } } + +export class InterfaceScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: TSESLintScope.Scope, + block: TSESTree.TSInterfaceDeclaration | null, + ) { + super(scopeManager, 'interface', upperScope, block, false); + } +} + +export class TypeAliasScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: TSESLintScope.Scope, + block: TSESTree.TSTypeAliasDeclaration | null, + ) { + super(scopeManager, 'type-alias', upperScope, block, false); + } +} + +// TODO: extend all Scopes 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/parameter-property-simple.ts b/packages/parser/tests/fixtures/scope-analysis/parameter-property-simple.ts new file mode 100644 index 000000000000..9292782b9538 --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/parameter-property-simple.ts @@ -0,0 +1,8 @@ +import { InjectRepository, Repository, User } from 'test'; + +export default class Foo { + constructor( + @InjectRepository(User) + userRepository: Repository, + ) {} +} diff --git a/packages/parser/tests/fixtures/scope-analysis/parameter-property.ts b/packages/parser/tests/fixtures/scope-analysis/parameter-property.ts new file mode 100644 index 000000000000..12d5c722c9ec --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/parameter-property.ts @@ -0,0 +1,8 @@ +import { InjectRepository, Repository, User } from 'test'; + +export default class Foo { + constructor( + @InjectRepository(User) + private readonly userRepository: Repository, + ) {} +} 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__/scope-analysis.ts.snap b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap index 78db01bfd950..ccab06f413f5 100644 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap @@ -370,7 +370,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 +380,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 8, "block": Object { "range": Array [ 0, @@ -390,7 +390,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 7, "block": Object { "range": Array [ 0, @@ -405,19 +405,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { - "$id": 1, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -453,7 +453,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 7, }, }, ], @@ -461,23 +461,151 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Component", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Nullable", + "range": Array [ + 41, + 49, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "SomeOther", + "range": Array [ + 50, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Component2", + "range": Array [ + 67, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 9, }, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "Nullable": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { "$id": 0, + "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": 3, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -513,7 +641,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, ], @@ -522,12 +650,22 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [], } @@ -856,7 +994,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 +1004,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 0, @@ -876,7 +1014,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 10, "block": Object { "range": Array [ 0, @@ -891,19 +1029,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo": Object { - "$ref": 6, + "$ref": 9, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { - "$id": 6, + "$id": 9, "defs": Array [ Object { "name": Object { @@ -939,13 +1077,13 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 10, }, }, ], }, Object { - "$id": 9, + "$id": 12, "block": Object { "range": Array [ 42, @@ -960,19 +1098,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo2": Object { - "$ref": 8, + "$ref": 11, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { - "$id": 8, + "$id": 11, "defs": Array [ Object { "name": Object { @@ -1008,13 +1146,13 @@ Object { "name": "Foo2", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 12, }, }, ], }, Object { - "$id": 11, + "$id": 14, "block": Object { "range": Array [ 84, @@ -1029,19 +1167,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo3": Object { - "$ref": 10, + "$ref": 13, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { - "$id": 10, + "$id": 13, "defs": Array [ Object { "name": Object { @@ -1077,7 +1215,7 @@ Object { "name": "Foo3", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 14, }, }, ], @@ -1089,7 +1227,24 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 12, + "$ref": 15, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1104,9 +1259,26 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 12, + "$ref": 15, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1121,9 +1293,26 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 12, + "$ref": 15, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 107, + 110, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1148,10 +1337,19 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, ], "type": "module", "upperScope": Object { - "$ref": 13, + "$ref": 16, }, "variableMap": Object { "Foo": Object { @@ -1165,7 +1363,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { @@ -1205,7 +1403,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, Object { @@ -1245,7 +1443,7 @@ Object { "name": "Foo2", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, Object { @@ -1285,7 +1483,7 @@ Object { "name": "Foo3", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, ], @@ -1304,186 +1502,157 @@ Object { Object { "$ref": 5, }, - ], - "type": "global", + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], + "type": "global", "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", + "block": Object { "range": Array [ - 26, - 32, + 7, + 38, ], - "type": "Identifier", + "type": "ClassDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 5, }, - "identifier": Object { - "name": "s1", - "range": Array [ - 54, - 56, - ], - "type": "Identifier", + "variableMap": Object { + "Bar": Object { + "$ref": 3, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 5, }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 3, + "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, + }, + }, + ], }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 7, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 5, }, "identifier": Object { - "name": "s2", + "name": "Foo", "range": Array [ - 71, - 73, + 27, + 30, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, - }, - Object { - "$ref": 5, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 6, }, "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { + "Bar": Object { "$ref": 1, }, + "T": Object { + "$ref": 0, + }, }, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, "variables": Array [ Object { @@ -1491,52 +1660,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "s1", + "name": "T", "range": Array [ - 6, - 8, + 17, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, + 16, + 35, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s1", + "name": "T", "range": Array [ - 6, - 8, + 17, + 18, ], "type": "Identifier", }, ], - "name": "s1", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], + "name": "T", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 5, }, }, Object { @@ -1544,52 +1700,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "s2", + "name": "Bar", "range": Array [ - 21, - 23, + 13, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 21, - 34, + 7, + 38, ], - "type": "VariableDeclarator", + "type": "ClassDeclaration", }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "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, }, }, ], @@ -1600,50 +1743,162 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, - }, - Object { - "$ref": 5, + "$ref": 2, }, ], "type": "global", "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 [], + "childScopes": Array [ + Object { + "$id": 11, + "block": Object { + "range": Array [ + 35, + 109, + ], + "type": "TSInterfaceDeclaration", + }, + "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": 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", + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "s1", @@ -1666,9 +1921,9 @@ Object { }, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -1683,9 +1938,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "s2", @@ -1708,9 +1963,9 @@ Object { }, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -1724,58 +1979,23 @@ Object { "resolved": null, "writeExpr": undefined, }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 51, - 53, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 68, - 70, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 13, }, "variableMap": Object { + "A": Object { + "$ref": 2, + }, "s1": Object { "$ref": 0, }, @@ -1784,7 +2004,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 12, }, "variables": Array [ Object { @@ -1830,14 +2050,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 7, + }, + Object { + "$ref": 9, }, ], "scope": Object { - "$ref": 8, + "$ref": 12, }, }, Object { @@ -1883,210 +2106,57 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 7, + "$ref": 8, + }, + Object { + "$ref": 10, }, ], "scope": Object { - "$ref": 8, + "$ref": 12, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "f", + "name": "A", "range": Array [ - 17, - 18, + 45, + 46, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 37, + 35, + 109, ], - "type": "TSDeclareFunction", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "A", "range": Array [ - 17, - 18, + 45, + 46, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "A", + "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 12, }, }, ], @@ -2095,61 +2165,87 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + ], "type": "global", "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/computed-properties-in-type.ts 1`] = ` Object { - "$id": 5, + "$id": 13, "block": Object { "range": Array [ 0, - 70, + 107, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 12, "block": Object { "range": Array [ 0, - 70, + 107, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 11, "block": Object { "range": Array [ - 0, - 69, + 35, + 106, ], - "type": "TSDeclareFunction", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 7, "from": Object { - "$ref": 3, + "$ref": 11, }, "identifier": Object { - "name": "subject", + "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 [ - 61, 68, + 70, ], "type": "Identifier", }, @@ -2159,176 +2255,83 @@ Object { }, "writeExpr": undefined, }, - ], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "subject": Object { - "$ref": 1, + 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, }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "subject", - "range": Array [ - 27, - 51, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "subject", - "range": Array [ - 27, - 51, - ], - "type": "Identifier", - }, - ], - "name": "subject", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 3, + "$id": 10, + "from": Object { + "$ref": 11, }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "eachr": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eachr", + "identifier": Object { + "name": "s2", "range": Array [ - 9, - 14, + 84, + 94, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "parent": null, - "type": "FunctionName", + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "eachr", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, ], - "name": "eachr", - "references": Array [], - "scope": Object { - "$ref": 4, + "type": "type-alias", + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, }, + "variables": Array [], }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-global.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 2, + "$ref": 12, }, "identifier": Object { - "name": "C", + "name": "s1", "range": Array [ - 38, - 39, + 6, + 8, ], "type": "Identifier", }, @@ -2338,263 +2341,361 @@ Object { }, "writeExpr": Object { "range": Array [ - 42, - 43, + 11, + 19, ], - "type": "Literal", + "type": "CallExpression", }, }, - ], - "throughReferences": Array [ Object { - "$ref": 1, + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "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", + "$id": 5, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "s2", "range": Array [ - 25, - 34, + 21, + 23, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { "range": Array [ - 25, + 26, 34, ], - "type": "VariableDeclarator", + "type": "CallExpression", }, - "parent": Object { + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", "range": Array [ - 21, - 34, + 26, + 32, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": true, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", + "$ref": 4, }, - ], - "name": "C", - "references": Array [ Object { - "$ref": 1, + "$ref": 6, }, ], - "scope": Object { - "$ref": 3, + "type": "module", + "upperScope": Object { + "$ref": 13, }, + "variableMap": Object { + "A": Object { + "$ref": 2, + }, + "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": undefined, + "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": undefined, + "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, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, }, ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-module.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function.ts 1`] = ` Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 95, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 95, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ - 33, - 92, + 0, + 37, ], - "type": "TSModuleBlock", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 89, - 90, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "empty-function", "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object { "a": Object { - "$ref": 3, - }, - "b": Object { - "$ref": 4, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { "name": "a", "range": Array [ - 52, - 61, + 19, + 28, ], "type": "Identifier", }, "node": Object { "range": Array [ - 52, - 61, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 46, - 61, + 0, + 37, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", "range": Array [ - 52, - 61, + 19, + 28, ], "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, + "$ref": 3, }, }, ], @@ -2606,38 +2707,13 @@ Object { 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, + "$ref": 4, }, "identifier": Object { - "name": "a", + "name": "f", "range": Array [ - 93, - 94, + 38, + 39, ], "type": "Identifier", }, @@ -2651,15 +2727,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 5, }, "variableMap": Object { - "a": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -2667,52 +2743,43 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "f", "range": Array [ - 6, - 7, + 17, + 18, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 11, + 37, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "f", "range": Array [ - 6, - 7, + 17, + 18, ], "type": "Identifier", }, ], - "name": "a", + "name": "f", "references": Array [ Object { "$ref": 1, }, - Object { - "$ref": 2, - }, ], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], @@ -2726,125 +2793,143 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, "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-function-with-typeof.ts 1`] = ` Object { - "$id": 7, + "$id": 10, "block": Object { "range": Array [ 0, - 65, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, - 65, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ - 15, - 64, + 0, + 69, ], - "type": "ClassDeclaration", + "type": "TSDeclareFunction", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { "$id": 4, - "block": Object { + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", "range": Array [ - 40, - 62, + 36, + 39, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "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, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, + "identifier": Object { + "name": "Key", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 4, + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ Object { - "$ref": 3, - }, - ], - "type": "class", + "$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", "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { - "Foo": Object { + "Key": Object { "$ref": 1, }, + "Value": Object { + "$ref": 2, + }, + "subject": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [ Object { @@ -2852,39 +2937,131 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "Key", "range": Array [ - 21, - 24, + 15, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 14, + 26, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "Key", "range": Array [ - 21, - 24, + 15, + 18, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "Key", + "references": Array [ + Object { + "$ref": 5, + }, + ], "scope": Object { - "$ref": 5, + "$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, }, }, ], @@ -2895,20 +3072,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 10, }, "variableMap": Object { - "Foo": Object { + "eachr": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [ Object { @@ -2916,39 +3093,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "eachr", "range": Array [ - 21, - 24, + 9, + 14, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 0, + 69, ], - "type": "ClassDeclaration", + "type": "TSDeclareFunction", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "eachr", "range": Array [ - 21, - 24, + 9, + 14, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "eachr", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 9, }, }, ], @@ -2959,171 +3136,219 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 10, }, "variables": Array [], } `; -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-global.ts 1`] = ` Object { - "$id": 8, + "$id": 3, "block": Object { "range": Array [ 0, - 65, + 55, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 2, "block": Object { "range": Array [ 0, - 65, + 55, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 6, - "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": 5, - "block": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 42, + 43, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "C": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 25, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 34, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 21, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 25, + 34, ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 3, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-module.ts 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 95, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 95, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 33, + 92, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "references": Array [ Object { - "$ref": 4, + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 89, + 90, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, }, ], - "type": "class", + "throughReferences": Array [], + "type": "block", "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "a": Object { + "$ref": 3, + }, + "b": Object { + "$ref": 4, }, }, "variableScope": Object { @@ -3131,40 +3356,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", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ + "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 +3456,59 @@ 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", "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "Foo": Object { + "a": Object { "$ref": 0, }, }, @@ -3199,37 +3521,50 @@ 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 [], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "scope": Object { "$ref": 7, }, @@ -3240,11 +3575,7 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -3255,13 +3586,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 +3602,7 @@ Object { "block": Object { "range": Array [ 0, - 60, + 65, ], "type": "Program", }, @@ -3281,7 +3612,7 @@ Object { "block": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3291,7 +3622,7 @@ Object { "block": Object { "range": Array [ 40, - 57, + 62, ], "type": "FunctionExpression", }, @@ -3385,7 +3716,7 @@ Object { "node": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3449,7 +3780,7 @@ Object { "node": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3495,13 +3826,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 +3842,7 @@ Object { "block": Object { "range": Array [ 0, - 82, + 65, ], "type": "Program", }, @@ -3521,7 +3852,7 @@ Object { "block": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3531,7 +3862,7 @@ Object { "block": Object { "range": Array [ 40, - 79, + 62, ], "type": "FunctionExpression", }, @@ -3596,15 +3927,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 +3948,8 @@ Object { Object { "name": "test", "range": Array [ - 63, - 75, + 46, + 58, ], "type": "Identifier", }, @@ -3668,7 +3999,7 @@ Object { "node": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3732,7 +4063,7 @@ Object { "node": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3778,43 +4109,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 +4154,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Dec", @@ -3842,23 +4173,20 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "function", "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 +4197,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 +4208,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -3933,7 +4221,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -3951,7 +4239,7 @@ Object { "node": Object { "range": Array [ 15, - 69, + 59, ], "type": "ClassDeclaration", }, @@ -3973,7 +4261,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -3984,12 +4272,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -3997,7 +4285,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -4015,7 +4303,7 @@ Object { "node": Object { "range": Array [ 15, - 69, + 59, ], "type": "ClassDeclaration", }, @@ -4037,7 +4325,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -4048,36 +4336,36 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "global", "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 +4374,93 @@ 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 { - "$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, + "$ref": 6, }, "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 +4469,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 +4489,40 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "function", + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "class", "upperScope": Object { - "$ref": 18, + "$ref": 7, }, "variableMap": Object { - "arguments": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 7, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - Object { - "$id": 17, - "block": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 16, - "block": Object { - "range": Array [ - 159, - 195, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 15, - }, - }, - "variableScope": Object { - "$ref": 16, - }, - "variables": Array [ - Object { - "$id": 15, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 16, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 13, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", - "range": Array [ - 122, - 125, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 14, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", - "range": Array [ - 147, - 150, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "C": Object { - "$ref": 12, + "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 +4533,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 +4552,23 @@ 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", "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,130 +4576,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "dec", + "name": "Foo", "range": Array [ - 9, - 12, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 29, + 15, + 81, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "dec", + "name": "Foo", "range": Array [ - 9, - 12, + 21, + 24, ], "type": "Identifier", }, ], - "name": "dec", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - ], - "name": "gec", - "references": Array [ - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], - "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 113, - 114, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 18, + "$ref": 7, }, }, ], @@ -4655,367 +4617,217 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", "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", + "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, + "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 { - "$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, + "$ref": 4, }, ], - "type": "enum", + "type": "class", "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, - "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, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Foo", "range": Array [ - 59, - 60, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 59, - 68, + 15, + 69, ], - "type": "TSEnumMember", + "type": "ClassDeclaration", }, "parent": undefined, - "type": "EnumMemberName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Foo", "range": Array [ - 59, - 60, + 21, + 24, ], "type": "Identifier", }, ], - "name": "C", - "references": Array [ - Object { - "$ref": 10, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 6, }, }, ], @@ -5023,48 +4835,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": 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", - }, + "$ref": 4, }, ], - "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 15, + "$ref": 8, }, "variableMap": Object { - "E": Object { - "$ref": 1, - }, - "a": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 7, }, "variables": Array [ Object { @@ -5072,95 +4859,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "E", + "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,415 +4900,448 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", "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", "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", + "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", + "upperScope": Object { + "$ref": 18, }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, + "variableMap": Object { + "arguments": Object { + "$ref": 7, + }, }, - "identifier": Object { - "name": "a", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", + "variableScope": Object { + "$ref": 11, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], }, - ], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-as.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", + "$id": 17, + "block": Object { "range": Array [ - 1, - 2, + 102, + 197, ], - "type": "Identifier", + "type": "ClassDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, + "childScopes": Array [ + Object { + "$id": 16, + "block": Object { + "range": Array [ + 159, + 195, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 15, + }, + }, + "variableScope": Object { + "$ref": 16, + }, + "variables": Array [ + Object { + "$id": 15, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 16, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "gec", + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "gec", + "range": Array [ + 147, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "C": Object { + "$ref": 12, + }, + }, + "variableScope": Object { + "$ref": 18, + }, + "variables": Array [ + Object { + "$id": 12, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 17, + }, + }, + ], }, ], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` -Object { - "$id": 15, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, + "$id": 3, "from": Object { - "$ref": 14, + "$ref": 18, }, "identifier": Object { - "name": "a", + "name": "dec", "range": Array [ - 37, - 38, + 103, + 106, ], "type": "Identifier", }, @@ -5587,153 +5351,25 @@ Object { }, "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, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 19, + }, + "variableMap": Object { + "C": Object { + "$ref": 2, }, - Object { - "$id": 9, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 48, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "e", - "range": Array [ - 60, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - Object { - "$id": 13, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 63, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { - "a": Object { + "dec": Object { "$ref": 0, }, - "b": Object { + "gec": Object { "$ref": 1, }, - "c": Object { - "$ref": 2, - }, - "d": Object { - "$ref": 3, - }, - "e": Object { - "$ref": 4, - }, - "f": Object { - "$ref": 5, - }, }, "variableScope": Object { - "$ref": 14, + "$ref": 18, }, "variables": Array [ Object { @@ -5741,49 +5377,43 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "dec", "range": Array [ - 6, - 7, + 9, + 12, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 29, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "dec", "range": Array [ - 6, - 7, + 9, + 12, ], "type": "Identifier", }, ], - "name": "a", + "name": "dec", "references": Array [ Object { - "$ref": 7, + "$ref": 3, }, ], "scope": Object { - "$ref": 14, + "$ref": 18, }, }, Object { @@ -5791,49 +5421,46 @@ Object { "defs": Array [ Object { "name": Object { - "name": "b", + "name": "gec", "range": Array [ - 9, - 10, + 39, + 42, ], "type": "Identifier", }, "node": Object { "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, + 30, + 100, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "b", + "name": "gec", "range": Array [ - 9, - 10, + 39, + 42, ], "type": "Identifier", }, ], - "name": "b", + "name": "gec", "references": Array [ Object { - "$ref": 8, + "$ref": 13, + }, + Object { + "$ref": 14, }, ], "scope": Object { - "$ref": 14, + "$ref": 18, }, }, Object { @@ -5841,199 +5468,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "c", + "name": "C", "range": Array [ - 12, - 13, + 113, + 114, ], "type": "Identifier", }, "node": Object { "range": Array [ - 12, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, + 102, + 197, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "c", + "name": "C", "range": Array [ - 12, - 13, + 113, + 114, ], "type": "Identifier", }, ], - "name": "c", - "references": Array [ - Object { - "$ref": 9, - }, - ], + "name": "C", + "references": Array [], "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "d", - "references": Array [ - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 18, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [ - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 13, - }, - ], - "scope": Object { - "$ref": 14, + "$ref": 18, }, }, ], @@ -6042,217 +5509,280 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 19, }, "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/empty-body-function.ts 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, - 101, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, - 101, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 19, - 46, + 69, ], "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "a": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { "$ref": 2, }, - }, + "subject": Object { + "$ref": 3, + }, + }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "Key", "range": Array [ - 30, - 39, + 15, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 19, - 46, + 14, + 26, ], - "type": "TSDeclareFunction", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "Parameter", + "type": "TypeParameter", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "Key", "range": Array [ - 30, - 39, + 15, + 18, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [], + "name": "Key", + "references": Array [ + Object { + "$ref": 5, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, - ], - }, - 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 [], + "$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 [], - "name": "arguments", - "references": Array [], + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, Object { - "$id": 5, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "subject", "range": Array [ - 58, - 68, + 27, + 51, ], "type": "Identifier", }, "node": Object { "range": Array [ - 47, - 100, + 0, + 69, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "subject", "range": Array [ - 58, - 68, + 27, + 51, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [], + "name": "subject", + "references": Array [ + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -6261,18 +5791,22 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { - "f": Object { + "eachr": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -6280,19 +5814,19 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "eachr", "range": Array [ - 56, - 57, + 9, + 14, ], "type": "Identifier", }, "node": Object { "range": Array [ - 47, - 100, + 0, + 69, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "FunctionName", @@ -6301,18 +5835,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "eachr", "range": Array [ - 56, - 57, + 9, + 14, ], "type": "Identifier", }, ], - "name": "f", + "name": "eachr", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -6321,402 +5855,371 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum.ts 1`] = ` Object { - "$id": 5, + "$id": 15, "block": Object { "range": Array [ 0, - 47, + 71, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 14, "block": Object { "range": Array [ 0, - 47, + 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": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "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": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "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", + }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ Object { - "name": Object { - "name": "f", + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "a", "range": Array [ - 9, - 10, + 37, + 38, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "B", "range": Array [ - 0, - 18, + 44, + 45, ], - "type": "TSDeclareFunction", + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": Object { + "range": Array [ + 48, + 53, + ], + "type": "BinaryExpression", }, - "parent": null, - "type": "FunctionName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 48, + 49, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, - ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ Object { - "$id": 5, - "block": Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "C", "range": Array [ - 35, - 62, + 59, + 60, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "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, + "kind": "w", + "resolved": Object { + "$ref": 5, }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, + "writeExpr": Object { + "range": Array [ + 63, + 68, + ], + "type": "BinaryExpression", }, - "variableScope": Object { - "$ref": 5, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 13, }, - "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, - }, - }, - ], + "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, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 7, + }, + Object { + "$ref": 9, }, ], - "type": "class", + "type": "enum", "upperScope": Object { - "$ref": 7, + "$ref": 14, }, "variableMap": Object { - "Test": Object { - "$ref": 1, + "A": Object { + "$ref": 3, + }, + "B": Object { + "$ref": 4, + }, + "C": Object { + "$ref": 5, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 14, }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "Test", + "name": "A", "range": Array [ - 13, - 17, + 33, + 34, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 64, + 33, + 38, ], - "type": "ClassDeclaration", + "type": "TSEnumMember", }, "parent": undefined, - "type": "ClassName", + "type": "EnumMemberName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Test", + "name": "A", "range": Array [ - 13, - 17, + 33, + 34, ], "type": "Identifier", }, ], - "name": "Test", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 11, + }, + ], "scope": Object { - "$ref": 6, + "$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, }, }, ], @@ -6724,122 +6227,48 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "Test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ + "references": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", - "references": Array [], - "scope": Object { - "$ref": 7, + "$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", }, }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 15, }, "variableMap": Object { + "E": Object { + "$ref": 1, + }, "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 14, }, "variables": Array [ Object { @@ -6849,22 +6278,22 @@ Object { "name": Object { "name": "a", "range": Array [ - 110, - 114, + 6, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ - 110, - 114, + 6, + 19, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 106, - 114, + 0, + 19, ], "type": "VariableDeclaration", }, @@ -6876,111 +6305,66 @@ Object { Object { "name": "a", "range": Array [ - 110, - 114, + 6, + 15, ], "type": "Identifier", }, ], "name": "a", - "references": Array [], + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 14, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "E", "range": Array [ - 7, - 10, + 25, + 26, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 27, + 20, + 70, ], - "type": "TSImportEqualsDeclaration", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "ImportBinding", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "E", "range": Array [ - 7, - 10, + 25, + 26, ], "type": "Identifier", }, ], - "name": "foo", + "name": "E", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 14, }, }, ], @@ -6994,193 +6378,128 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 15, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum-string.ts 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 16, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/interface-type.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 143, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 143, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ + 0, 28, - 142, ], - "type": "FunctionDeclaration", + "type": "TSEnumDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { - "name": "text", + "name": "BAR", "range": Array [ - 116, - 120, + 15, + 18, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 0, + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "Literal", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, }, ], - "type": "function", + "throughReferences": Array [], + "type": "enum", "upperScope": Object { - "$ref": 6, + "$ref": 4, }, "variableMap": Object { - "arguments": Object { - "$ref": 3, + "BAR": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { - "$id": 3, - "defs": Array [], + "$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 [], - "name": "arguments", - "references": Array [], + "identifiers": Array [ + Object { + "name": "BAR", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "BAR", + "references": Array [ + Object { + "$ref": 2, + }, + ], "scope": Object { - "$ref": 5, + "$ref": 3, }, }, ], @@ -7188,48 +6507,19 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "text", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 19, - ], - "type": "Literal", - }, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "text": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, "variables": Array [ Object { @@ -7237,92 +6527,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "text", + "name": "Foo", "range": Array [ - 6, - 10, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 20, + 28, ], - "type": "VariableDeclaration", + "type": "TSEnumDeclaration", }, - "type": "Variable", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "text", + "name": "Foo", "range": Array [ - 6, - 10, + 5, + 8, ], "type": "Identifier", }, ], - "name": "text", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 28, - 142, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, + "$ref": 4, }, }, ], @@ -7336,249 +6573,46 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/method-overload.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` Object { - "$id": 11, + "$id": 2, "block": Object { "range": Array [ 0, - 124, + 23, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 1, "block": Object { "range": Array [ 0, - 124, + 23, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "a": Object { - "$ref": 7, - }, - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 18, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, + "$id": 0, "from": Object { - "$ref": 10, + "$ref": 1, }, "identifier": Object { - "name": "Symbol", + "name": "a", "range": Array [ - 10, - 16, + 20, + 21, ], "type": "Identifier", }, @@ -7589,119 +6623,18 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "s", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -7709,203 +6642,251 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 2, }, "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/expression-as.ts 1`] = ` Object { - "$id": 10, + "$id": 2, "block": Object { "range": Array [ 0, - 63, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 1, "block": Object { "range": Array [ 0, - 63, + 27, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 24, - 56, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 47, - 48, - ], - "type": "Literal", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "a": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 43, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 37, - 48, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 9, + "$ref": 1, }, "identifier": Object { "name": "a", "range": Array [ - 6, - 7, + 1, + 2, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` +Object { + "$id": 17, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 16, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "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": Object { + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", "range": Array [ - 10, - 11, + 40, + 41, ], - "type": "Literal", + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, }, + "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 10, "from": Object { - "$ref": 9, + "$ref": 16, }, "identifier": Object { - "name": "a", + "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, @@ -7914,45 +6895,89 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 3, }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 14, "from": Object { - "$ref": 9, + "$ref": 16, }, "identifier": Object { - "name": "N", + "name": "e", "range": Array [ - 59, 60, + 61, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 1, + "$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 [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 17, }, "variableMap": Object { - "N": Object { - "$ref": 1, - }, "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": 9, + "$ref": 16, }, "variables": Array [ Object { @@ -7970,14 +6995,14 @@ Object { "node": Object { "range": Array [ 6, - 11, + 7, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 11, + 22, ], "type": "VariableDeclaration", }, @@ -7998,14 +7023,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "$ref": 8, }, ], "scope": Object { - "$ref": 9, + "$ref": 16, }, }, Object { @@ -8013,298 +7035,288 @@ Object { "defs": Array [ Object { "name": Object { - "name": "N", + "name": "b", "range": Array [ - 22, - 23, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 12, - 56, + 9, + 10, ], - "type": "TSModuleDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "NamespaceName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "N", + "name": "b", "range": Array [ - 22, - 23, + 9, + 10, ], "type": "Identifier", }, ], - "name": "N", + "name": "b", "references": Array [ Object { - "$ref": 4, + "$ref": 9, }, ], "scope": Object { - "$ref": 9, + "$ref": 16, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/rest-element.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "args": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ + "$id": 2, + "defs": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, + "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 { - "$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": "c", + "range": Array [ + 12, + 13, ], - "name": "args", - "references": Array [], - "scope": Object { - "$ref": 3, - }, + "type": "Identifier", }, ], + "name": "c", + "references": Array [ + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 16, + }, }, - ], - "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, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "d", "range": Array [ - 9, - 12, + 15, + 16, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 15, + 16, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 34, + 22, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "d", "range": Array [ - 9, - 12, + 15, + 16, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [], + "name": "d", + "references": Array [ + Object { + "$ref": 13, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 16, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-alias.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "e", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 18, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "e", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + ], + "name": "e", + "references": Array [ + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$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, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 17, }, "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/function-overload.ts 1`] = ` Object { "$id": 8, "block": Object { "range": Array [ 0, - 103, + 101, ], "type": "Program", }, @@ -8314,157 +7326,180 @@ Object { "block": Object { "range": Array [ 0, - 103, + 101, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ - 32, - 102, + 0, + 18, ], - "type": "ClassDeclaration", + "type": "TSDeclareFunction", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { + "range": Array [ + 19, + 46, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ Object { - "$id": 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 [ + "$id": 2, + "defs": Array [ Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, + "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 { - "$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, - }, + "range": Array [ + 30, + 39, + ], + "type": "Identifier", }, ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], + }, + Object { + "$id": 6, + "block": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "function", "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "C": Object { - "$ref": 2, + "a": Object { + "$ref": 5, + }, + "arguments": Object { + "$ref": 4, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { - "$id": 2, + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 5, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "a", "range": Array [ - 38, - 39, + 58, + 68, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 102, + 47, + 100, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "a", "range": Array [ - 38, - 39, + 58, + 68, ], "type": "Identifier", }, ], - "name": "C", + "name": "a", "references": Array [], "scope": Object { "$ref": 6, @@ -8482,10 +7517,7 @@ Object { "$ref": 8, }, "variableMap": Object { - "C": Object { - "$ref": 1, - }, - "a": Object { + "f": Object { "$ref": 0, }, }, @@ -8498,82 +7530,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", - "range": Array [ - 20, - 31, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 31, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 20, - 31, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", + "name": "f", "range": Array [ - 38, - 39, + 56, + 57, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 102, + 47, + 100, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "f", "range": Array [ - 38, - 39, + 56, + 57, ], "type": "Identifier", }, ], - "name": "C", + "name": "f", "references": Array [], "scope": Object { "$ref": 7, @@ -8596,13 +7582,13 @@ 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/function-overload-2.ts 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 40, + 47, ], "type": "Program", }, @@ -8612,204 +7598,100 @@ Object { "block": Object { "range": Array [ 0, - 40, + 47, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", + "$id": 1, + "block": Object { "range": Array [ - 17, + 0, 18, ], - "type": "Identifier", + "type": "TSDeclareFunction", }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "TSTypeAssertion", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 4, }, - }, - Object { - "$id": 1, - "from": Object { + "variableMap": Object {}, + "variableScope": Object { "$ref": 4, }, - "identifier": Object { - "name": "b", + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { "range": Array [ - 25, - 26, + 19, + 46, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 32, - 38, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "empty-function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", + "$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": 2, + "$ref": 3, }, }, ], @@ -8821,7 +7703,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -8829,7 +7711,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -8849,7 +7731,7 @@ Object { 0, 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "FunctionName", @@ -8869,7 +7751,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -8883,124 +7765,272 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` Object { - "$id": 3, + "$id": 8, "block": Object { "range": Array [ 0, - 39, + 65, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 7, "block": Object { "range": Array [ 0, - 39, + 65, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", + "$id": 6, + "block": Object { "range": Array [ - 6, 7, + 64, ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 37, - ], - "type": "JSXElement", + "type": "ClassDeclaration", }, - }, - ], - "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 [ + "childScopes": Array [ Object { - "name": Object { - "name": "a", + "$id": 5, + "block": Object { "range": Array [ - 6, - 7, + 35, + 62, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Decorator", + "range": Array [ + 37, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "config": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "config", + "range": Array [ + 47, + 53, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 62, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "config", + "range": Array [ + 47, + 53, + ], + "type": "Identifier", + }, + ], + "name": "config", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Test": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "Test": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Test", "range": Array [ - 6, - 37, + 13, + 17, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "node": Object { "range": Array [ - 0, - 38, + 7, + 64, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "Test", "range": Array [ - 6, - 7, + 13, + 17, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "Test", + "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 7, }, }, ], @@ -9009,82 +8039,248 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "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/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 4, + "$id": 14, "block": Object { "range": Array [ 0, - 43, + 115, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 13, "block": Object { "range": Array [ 0, - 43, + 115, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "obj", + "$id": 5, + "block": Object { "range": Array [ - 4, - 7, - ], - "type": "Identifier", + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 13, }, - "writeExpr": Object { + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], + }, + Object { + "$id": 7, + "block": Object { "range": Array [ - 10, - 22, + 16, + 44, ], - "type": "ObjectExpression", + "type": "TSInterfaceDeclaration", + }, + "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", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, }, + "variables": Array [], }, Object { - "$id": 2, + "$id": 12, + "block": Object { + "range": Array [ + 45, + 104, + ], + "type": "TSInterfaceDeclaration", + }, + "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": Object { + "$ref": 3, + }, + "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", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 13, }, "identifier": Object { - "name": "obj", + "name": "C", "range": Array [ - 39, - 42, + 113, + 114, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 2, }, "writeExpr": undefined, }, @@ -9092,15 +8288,24 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 14, }, "variableMap": Object { - "obj": Object { + "A": Object { "$ref": 0, }, + "B": Object { + "$ref": 1, + }, + "C": Object { + "$ref": 2, + }, + "a": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 3, + "$ref": 13, }, "variables": Array [ Object { @@ -9108,321 +8313,188 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "A", "range": Array [ - 4, - 7, + 5, + 6, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 15, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "A", "range": Array [ - 4, - 7, + 5, + 6, ], "type": "Identifier", }, ], - "name": "obj", + "name": "A", "references": Array [ Object { - "$ref": 1, + "$ref": 6, }, Object { - "$ref": 2, + "$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/typeof-in-assertions.ts 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 27, - 40, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 46, - 61, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 46, - 47, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "B", "range": Array [ - 4, - 7, + 26, + 27, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, + 16, + 44, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "B", "range": Array [ - 4, - 7, + 26, + 27, ], "type": "Identifier", }, ], - "name": "obj", + "name": "B", "references": Array [ Object { - "$ref": 1, + "$ref": 8, }, + ], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 2, + "defs": Array [ Object { - "$ref": 3, + "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 { - "$ref": 7, + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", }, ], - "scope": Object { - "$ref": 8, - }, + "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 [ + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 13, + }, }, ], }, @@ -9430,206 +8502,53 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 14, }, "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/import-equals.ts 1`] = ` Object { - "$id": 9, + "$id": 2, "block": Object { "range": Array [ 0, - 165, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 1, "block": Object { "range": Array [ 0, - 165, + 28, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 24, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 76, - 79, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 95, - 98, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 125, - 128, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 140, - 143, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 159, - 162, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 2, }, "variableMap": Object { - "obj": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 1, }, "variables": Array [ Object { @@ -9637,67 +8556,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "foo", "range": Array [ - 6, - 9, + 7, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 24, + 27, ], - "type": "VariableDeclaration", + "type": "TSImportEqualsDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "foo", "range": Array [ - 6, - 9, + 7, + 10, ], "type": "Identifier", }, ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], + "name": "foo", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 1, }, }, ], @@ -9711,199 +8602,46 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 2, }, "variables": Array [], } `; -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/import-keyword.ts 1`] = ` Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 83, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 0, "block": Object { "range": Array [ 0, - 83, + 16, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -9914,29 +8652,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 1, }, "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/interface-type.ts 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, - 62, + 67, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, - 62, + 67, ], "type": "Program", }, @@ -9946,124 +8684,115 @@ Object { "block": Object { "range": Array [ 0, - 61, + 25, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], + }, + Object { + "$id": 6, + "block": Object { + "range": Array [ + 27, + 66, + ], + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { - "name": "g", + "name": "C", "range": Array [ - 28, - 29, + 63, + 64, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 1, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "g": Object { - "$ref": 2, + "throughReferences": Array [ + Object { + "$ref": 5, }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 7, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "g", - "range": Array [ - 31, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "g", - "range": Array [ - 31, - 35, - ], - "type": "Identifier", - }, - ], - "name": "g", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { - "g": Object { + "C": Object { + "$ref": 1, + }, + "R": Object { + "$ref": 2, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -10071,39 +8800,153 @@ Object { "defs": Array [ Object { "name": Object { - "name": "g", + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 11, + 20, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + 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 [ + 12, + 13, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "C", "range": Array [ - 9, 10, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 61, + 25, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "g", + "name": "C", "range": Array [ - 9, 10, + 11, ], "type": "Identifier", }, ], - "name": "g", + "name": "C", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 2, + "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": 5, + "$ref": 7, }, }, ], @@ -10117,215 +8960,142 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "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/jsx-attributes.tsx 1`] = ` Object { - "$id": 12, + "$id": 7, "block": Object { "range": Array [ 0, - 147, + 143, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 6, "block": Object { "range": Array [ 0, - 147, + 143, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", + "$id": 5, + "block": Object { "range": Array [ - 4, - 7, + 28, + 142, ], - "type": "Identifier", + "type": "FunctionDeclaration", }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 46, - 58, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 11, + "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, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "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": true, + "references": Array [ Object { - "$id": 7, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 6, }, "identifier": Object { - "name": "value", + "name": "text", "range": Array [ - 65, - 70, + 6, + 10, ], "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, + 13, + 19, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "type": "Literal", }, - "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 7, }, "variableMap": Object { - "element": Object { - "$ref": 3, - }, - "obj": Object { - "$ref": 0, - }, - "obj2": Object { + "Foo": Object { "$ref": 1, }, - "value": Object { - "$ref": 2, + "text": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 6, }, "variables": Array [ Object { @@ -10333,24 +9103,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "text", "range": Array [ - 4, - 7, + 6, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 22, + 6, + 19, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, + 20, ], "type": "VariableDeclaration", }, @@ -10360,31 +9130,25 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "text", "range": Array [ - 4, - 7, + 6, + 10, ], "type": "Identifier", }, ], - "name": "obj", + "name": "text", "references": Array [ Object { - "$ref": 4, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 8, + "$ref": 2, }, Object { - "$ref": 10, + "$ref": 4, }, ], "scope": Object { - "$ref": 11, + "$ref": 6, }, }, Object { @@ -10392,149 +9156,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj2", + "name": "Foo", "range": Array [ - 27, - 43, + 37, + 40, ], "type": "Identifier", }, "node": Object { "range": Array [ - 27, - 58, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 23, - 58, + 28, + 142, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "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", + "name": "Foo", "range": Array [ - 105, - 112, + 37, + 40, ], "type": "Identifier", }, ], - "name": "element", - "references": Array [ - Object { - "$ref": 9, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 6, }, }, ], @@ -10548,300 +9202,299 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "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/method-overload.ts 1`] = ` Object { - "$id": 2, + "$id": 12, "block": Object { "range": Array [ 0, - 49, + 124, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 11, "block": Object { "range": Array [ 0, - 49, + 124, ], "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 [ + "$id": 10, + "block": Object { + "range": Array [ + 19, + 123, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "x", + "$id": 9, + "block": Object { "range": Array [ - 4, - 47, + 73, + 121, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 10, }, - "parent": Object { - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", + "variableMap": Object { + "a": Object { + "$ref": 8, + }, + "arguments": Object { + "$ref": 7, + }, }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", + "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, + }, + }, + ], }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "x", + "$id": 5, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "a", "range": Array [ - 4, - 45, + 49, + 60, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 10, }, - "parent": Object { + "identifier": Object { + "name": "s", "range": Array [ - 0, - 46, + 59, + 60, ], - "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, - 45, - ], - "type": "Identifier", + "$ref": 5, + }, + Object { + "$ref": 6, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, + "type": "class", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "A": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 11, }, + "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": 10, + }, + }, + ], }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", "upperScope": Object { - "$ref": 2, + "$ref": 12, }, "variableMap": Object { - "x": Object { + "A": Object { + "$ref": 1, + }, + "s": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 11, }, "variables": Array [ Object { @@ -10849,24 +9502,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "s", "range": Array [ - 4, - 11, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 11, + 6, + 18, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 12, + 18, ], "type": "VariableDeclaration", }, @@ -10876,18 +9529,65 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "s", "range": Array [ - 4, - 11, + 6, + 7, ], "type": "Identifier", }, ], - "name": "x", + "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": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "name": "A", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 11, }, }, ], @@ -10896,153 +9596,126 @@ 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-infer.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 3, }, - ], - "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 [], + "$ref": 5, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 12, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/mixed-variable-ref.ts 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 37, + 32, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 37, + 32, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 13, + ], + "type": "Literal", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "test", + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "map": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -11050,24 +9723,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "map", + "name": "foo", "range": Array [ - 4, - 35, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 35, + 6, + 13, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 36, + 14, ], "type": "VariableDeclaration", }, @@ -11077,18 +9750,25 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "foo", "range": Array [ - 4, - 35, + 6, + 9, ], "type": "Identifier", }, ], - "name": "map", - "references": Array [], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -11097,154 +9777,252 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "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/namespace.ts 1`] = ` Object { - "$id": 2, + "$id": 10, "block": Object { "range": Array [ 0, - 47, + 63, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ 0, - 47, + 63, ], "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 [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 8, + "block": Object { + "range": Array [ + 24, + 56, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "map", + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", "range": Array [ - 4, - 45, + 43, + 44, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { "range": Array [ - 4, - 45, + 47, + 48, ], - "type": "VariableDeclarator", + "type": "Literal", }, - "parent": Object { + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", "range": Array [ - 0, - 46, + 53, + 54, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "a": Object { + "$ref": 5, }, - ], - "name": "map", - "references": Array [], - "scope": Object { - "$ref": 1, }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [], + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 48, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 37, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 11, + ], + "type": "Literal", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "N", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 10, }, "variableMap": Object { - "map": Object { + "N": Object { + "$ref": 1, + }, + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 9, }, "variables": Array [ Object { @@ -11252,24 +10030,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "map", + "name": "a", "range": Array [ - 4, - 46, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 46, + 6, + 11, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 47, + 11, ], "type": "VariableDeclaration", }, @@ -11279,18 +10057,69 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "a", "range": Array [ - 4, - 46, + 6, + 7, ], "type": "Identifier", }, ], - "name": "map", - "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, }, }, ], @@ -11304,598 +10133,507 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-plus.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/parameter-property.ts 1`] = ` Object { - "$id": 2, + "$id": 14, "block": Object { "range": Array [ 0, - 49, + 194, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 13, "block": Object { "range": Array [ 0, - 49, + 194, ], "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 [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 12, + "block": Object { + "range": Array [ + 75, + 193, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "map", + "$id": 11, + "block": Object { "range": Array [ - 4, - 47, + 100, + 191, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Repository", + "range": Array [ + 167, + 177, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "User", + "range": Array [ + 178, + 182, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "InjectRepository", + "range": Array [ + 107, + 123, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "User", + "range": Array [ + 124, + 128, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 5, + }, + "userRepository": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 5, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "userRepository", + "range": Array [ + 151, + 183, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 100, + 191, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "userRepository", + "range": Array [ + 151, + 183, + ], + "type": "Identifier", + }, + ], + "name": "userRepository", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 75, + 193, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 3, + }, + "InjectRepository": Object { + "$ref": 0, + }, + "Repository": Object { + "$ref": 1, + }, + "User": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "InjectRepository", + "range": Array [ + 9, + 25, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 47, + 9, + 25, ], - "type": "VariableDeclarator", + "type": "ImportSpecifier", }, "parent": Object { "range": Array [ 0, - 48, + 58, ], - "type": "VariableDeclaration", + "type": "ImportDeclaration", }, - "type": "Variable", + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "InjectRepository", "range": Array [ - 4, - 47, + 9, + 25, ], "type": "Identifier", }, ], - "name": "map", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, + "name": "InjectRepository", + "references": Array [ + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 13, + }, }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "x", + "name": "Repository", "range": Array [ - 4, - 8, + 27, + 37, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 8, + 27, + 37, ], - "type": "VariableDeclarator", + "type": "ImportSpecifier", }, "parent": Object { "range": Array [ 0, - 9, + 58, ], - "type": "VariableDeclaration", + "type": "ImportDeclaration", }, - "type": "Variable", + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "Repository", "range": Array [ - 4, - 8, + 27, + 37, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "Repository", + "references": Array [ + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 13, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "x", + "name": "User", "range": Array [ - 4, - 20, + 39, + 43, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 20, + 39, + 43, ], - "type": "VariableDeclarator", + "type": "ImportSpecifier", }, "parent": Object { "range": Array [ 0, - 21, + 58, ], - "type": "VariableDeclaration", + "type": "ImportDeclaration", }, - "type": "Variable", + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "User", "range": Array [ - 4, - 20, + 39, + 43, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic-nested.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + "name": "User", + "references": 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", + "$ref": 8, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "x", - "range": Array [ - 4, - 27, - ], - "type": "Identifier", + "$ref": 10, }, ], - "name": "x", - "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 13, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "x", + "name": "Foo", "range": Array [ - 4, - 31, + 81, + 84, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 32, + 75, + 193, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "Foo", "range": Array [ - 4, - 31, + 81, + 84, ], "type": "Identifier", }, ], - "name": "x", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 13, }, }, ], @@ -11909,149 +10647,314 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 14, }, "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/parameter-property-simple.ts 1`] = ` Object { - "$id": 2, + "$id": 14, "block": Object { "range": Array [ 0, - 11, + 177, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 13, "block": Object { "range": Array [ 0, - 11, + 177, ], "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 [ + "$id": 12, + "block": Object { + "range": Array [ + 75, + 176, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", - }, - "node": Object { + "$id": 11, + "block": Object { "range": Array [ - 4, - 9, + 100, + 174, ], - "type": "VariableDeclarator", + "type": "FunctionExpression", }, - "parent": Object { - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "InjectRepository", + "range": Array [ + 107, + 123, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "User", + "range": Array [ + 124, + 128, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Repository", + "range": Array [ + 150, + 160, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "User", + "range": Array [ + 161, + 165, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 12, }, - "type": "Variable", + "variableMap": Object { + "arguments": Object { + "$ref": 5, + }, + "userRepository": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 5, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "userRepository", + "range": Array [ + 134, + 166, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 100, + 174, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "userRepository", + "range": Array [ + 134, + 166, + ], + "type": "Identifier", + }, + ], + "name": "userRepository", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "name": "x", - "range": Array [ - 4, - 9, - ], - "type": "Identifier", + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, + "type": "class", + "upperScope": Object { + "$ref": 13, }, + "variableMap": Object { + "Foo": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 75, + 176, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$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-tuple-optional.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 14, }, "variableMap": Object { - "x": Object { + "Foo": Object { + "$ref": 3, + }, + "InjectRepository": Object { "$ref": 0, }, + "Repository": Object { + "$ref": 1, + }, + "User": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 1, + "$ref": 13, }, "variables": Array [ Object { @@ -12059,146 +10962,192 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "InjectRepository", "range": Array [ - 4, - 44, + 9, + 25, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 44, + 9, + 25, ], - "type": "VariableDeclarator", + "type": "ImportSpecifier", }, "parent": Object { "range": Array [ 0, - 44, + 58, ], - "type": "VariableDeclaration", + "type": "ImportDeclaration", }, - "type": "Variable", + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "InjectRepository", "range": Array [ - 4, - 44, + 9, + 25, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "InjectRepository", + "references": Array [ + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 13, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-rest.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Repository", + "range": Array [ + 27, + 37, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 37, + ], + "type": "ImportSpecifier", + }, + "parent": Object { + "range": Array [ + 0, + 58, + ], + "type": "ImportDeclaration", + }, + "type": "ImportBinding", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Repository", + "range": Array [ + 27, + 37, + ], + "type": "Identifier", + }, + ], + "name": "Repository", + "references": Array [ + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 13, + }, }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "x", + "name": "User", "range": Array [ - 4, - 28, + 39, + 43, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 28, + 39, + 43, ], - "type": "VariableDeclarator", + "type": "ImportSpecifier", }, "parent": Object { "range": Array [ 0, - 28, + 58, ], - "type": "VariableDeclaration", + "type": "ImportDeclaration", }, - "type": "Variable", + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "User", "range": Array [ - 4, - 28, + 39, + 43, ], "type": "Identifier", }, ], - "name": "x", + "name": "User", + "references": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 75, + 176, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + ], + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 13, }, }, ], @@ -12212,98 +11161,132 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 14, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/rest-element.ts 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 29, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, - 29, + 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 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 [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "args": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "args", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 34, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "args", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + ], + "name": "args", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "obj": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -12311,45 +11294,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, - 22, + 9, + 12, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 23, + 34, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, - 22, + 9, + 12, ], "type": "Identifier", }, ], - "name": "obj", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -12363,19 +11340,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-operator.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 38, + 18, ], "type": "Program", }, @@ -12385,11 +11362,36 @@ Object { "block": Object { "range": Array [ 0, - 38, + 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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], @@ -12399,12 +11401,9 @@ Object { "$ref": 3, }, "variableMap": Object { - "x": Object { + "foo": Object { "$ref": 0, }, - "y": Object { - "$ref": 1, - }, }, "variableScope": Object { "$ref": 2, @@ -12415,88 +11414,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "foo", "range": Array [ - 4, - 14, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 15, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 36, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 37, + 17, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "y", + "name": "foo", "range": Array [ - 20, - 36, + 5, + 8, ], "type": "Identifier", }, ], - "name": "y", + "name": "foo", "references": Array [], "scope": Object { "$ref": 2, @@ -12519,64 +11466,299 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-typeof.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` Object { - "$id": 3, + "$id": 13, "block": Object { "range": Array [ 0, - 19, + 103, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 12, "block": Object { "range": Array [ 0, - 19, + 103, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "y", + "$id": 4, + "block": Object { "range": Array [ - 14, + 0, 15, ], - "type": "Identifier", + "type": "TSTypeAliasDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "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": 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": 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, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "function", + "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", + "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, + }, + }, + ], }, ], - "throughReferences": Array [ + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$ref": 1, + "$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", "upperScope": Object { - "$ref": 3, + "$ref": 13, }, "variableMap": Object { - "x": Object { + "A": Object { "$ref": 0, }, + "C": Object { + "$ref": 2, + }, + "a": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 2, + "$ref": 12, }, "variables": Array [ Object { @@ -12584,230 +11766,74 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "A", "range": Array [ - 4, - 17, + 5, + 6, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 18, + 15, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "A", "range": Array [ - 4, - 17, + 5, + 6, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-intersection.src.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "intersection": Object { - "$ref": 1, - }, - "precedence1": Object { - "$ref": 2, - }, - "precedence2": Object { - "$ref": 3, - }, - "union": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "union", - "range": Array [ - 4, - 36, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 36, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 37, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ + "name": "A", + "references": Array [ Object { - "name": "union", - "range": Array [ - 4, - 36, - ], - "type": "Identifier", + "$ref": 3, }, - ], - "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", + "$ref": 8, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "intersection", - "range": Array [ - 42, - 71, - ], - "type": "Identifier", + "$ref": 9, }, ], - "name": "intersection", - "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 12, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "precedence1", + "name": "a", "range": Array [ - 77, - 115, + 20, + 31, ], "type": "Identifier", }, "node": Object { "range": Array [ - 77, - 115, + 20, + 31, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 73, - 116, + 16, + 31, ], "type": "VariableDeclaration", }, @@ -12817,64 +11843,58 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "precedence1", + "name": "a", "range": Array [ - 77, - 115, + 20, + 31, ], "type": "Identifier", }, ], - "name": "precedence1", + "name": "a", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 12, }, }, Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "precedence2", + "name": "C", "range": Array [ - 121, - 159, + 38, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 121, - 159, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 117, - 160, + 32, + 102, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "precedence2", + "name": "C", "range": Array [ - 121, - 159, + 38, + 39, ], "type": "Identifier", }, ], - "name": "precedence2", + "name": "C", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 12, }, }, ], @@ -12888,176 +11908,252 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 13, }, "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/type-assertions.ts 1`] = ` Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ 0, - 27, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 8, "block": Object { "range": Array [ 0, - 27, + 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", + "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: 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": 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": 4, + "$ref": 8, }, "identifier": Object { - "name": "bar", + "name": "b", "range": Array [ - 45, - 48, + 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": 2, + "$ref": 0, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "function", + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "bar": Object { - "$ref": 2, + "A": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "A", "range": Array [ - 15, - 18, + 5, + 6, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 51, + 16, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "Parameter", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", + "name": "A", "range": Array [ - 15, - 18, + 5, + 6, ], "type": "Identifier", }, ], - "name": "bar", + "name": "A", "references": Array [ Object { - "$ref": 3, + "$ref": 2, + }, + Object { + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -13066,138 +12162,190 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "foo": Object { - "$ref": 0, + "throughReferences": Array [ + Object { + "$ref": 1, }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, }, ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 9, + }, + "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/type-parameter.ts 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 69, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 68, + 19, ], - "type": "ClassDeclaration", + "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "T": 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": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 13, + ], + "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, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "A": Object { - "$ref": 1, + "f": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "f", "range": Array [ - 15, - 16, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 68, + 18, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "f", "range": Array [ - 15, - 16, + 9, + 10, ], "type": "Identifier", }, ], - "name": "A", + "name": "f", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -13209,91 +12357,93 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 68, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "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/typed-jsx-element.tsx 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 83, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 82, + 39, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, + "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", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "a": Object { + "$ref": 0, }, }, "variableScope": Object { @@ -13301,43 +12451,53 @@ Object { }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 37, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 82, + 38, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": undefined, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -13346,184 +12506,164 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 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/typed-this.src.ts 1`] = ` Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 63, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ - 19, - 62, + 0, + 31, ], - "type": "ClassDeclaration", + "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "s", + "$id": 3, + "block": Object { "range": Array [ - 43, - 44, + 0, + 30, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "type": "FunctionDeclaration", }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, + "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", + "upperScope": Object { + "$ref": 4, }, - "identifier": Object { - "name": "s", - "range": Array [ - 50, - 51, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 3, }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [ Object { - "$ref": 5, - }, - Object { - "$ref": 6, + "$ref": 2, }, ], - "type": "class", + "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 5, }, "variableMap": Object { - "A": Object { - "$ref": 4, + "test": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, "variables": Array [ Object { - "$id": 4, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "test", "range": Array [ - 25, - 26, + 9, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ - 19, - 62, + 0, + 30, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "test", "range": Array [ - 25, - 26, + 9, + 13, ], "type": "Identifier", }, ], - "name": "A", + "name": "test", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], @@ -13531,383 +12671,229 @@ 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", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 10, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 2, }, ], "type": "global", "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, - "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/typeof.ts 1`] = ` Object { - "$id": 12, + "$id": 6, "block": Object { "range": Array [ 0, - 117, + 43, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, - 40, + 43, ], - "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": 4, + "block": Object { + "range": Array [ + 23, + 42, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", + "$id": 3, + "from": Object { + "$ref": 4, }, - "node": Object { + "identifier": Object { + "name": "obj", "range": Array [ - 0, - 40, + 39, + 42, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", + "$ref": 3, }, ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, + "type": "type-alias", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, }, + "variables": Array [], }, ], - }, - Object { - "$id": 9, - "block": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "childScopes": 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": "class", + "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 6, }, "variableMap": Object { - "Foo2": Object { - "$ref": 8, + "B": Object { + "$ref": 1, + }, + "obj": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 5, }, "variables": Array [ Object { - "$id": 8, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "Foo2", + "name": "obj", "range": Array [ - 56, - 60, + 4, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 42, - 82, + 4, + 22, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo2", + "name": "obj", "range": Array [ - 56, - 60, + 4, + 7, ], "type": "Identifier", }, ], - "name": "Foo2", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "scope": Object { - "$ref": 9, + "$ref": 5, }, }, - ], - }, - 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, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "Foo3", + "name": "B", "range": Array [ - 90, - 94, + 28, + 29, ], "type": "Identifier", }, "node": Object { "range": Array [ - 84, - 116, + 23, + 42, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo3", + "name": "B", "range": Array [ - 90, - 94, + 28, + 29, ], "type": "Identifier", }, ], - "name": "Foo3", + "name": "B", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 5, }, }, ], @@ -13915,637 +12901,11073 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 69, - 72, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - "Foo2": Object { - "$ref": 1, - }, - "Foo3": Object { - "$ref": 2, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 6, }, - "variables": Array [ + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` +Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 63, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 8, + "block": Object { + "range": Array [ + 0, + 63, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "Foo", + "$id": 1, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 15, - 18, + 4, + 7, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { "range": Array [ - 0, - 40, + 10, + 22, ], - "type": "ClassDeclaration", + "type": "ObjectExpression", }, - "parent": null, - "type": "ClassName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", + "$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", + }, }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 1, - "defs": Array [ Object { - "name": Object { - "name": "Foo2", + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 56, - 60, + 35, + 38, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", "range": Array [ - 42, - 82, + 39, + 40, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "ClassName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", + "$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", + }, }, - ], - "name": "Foo2", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 2, - "defs": Array [ Object { - "name": Object { - "name": "Foo3", + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", "range": Array [ - 90, - 94, + 46, + 47, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 84, - 116, + 58, + 61, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "ClassName", + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, }, ], - "name": "Foo3", - "references": Array [], - "scope": Object { - "$ref": 12, + "type": "module", + "upperScope": Object { + "$ref": 9, }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 110, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", + "variableMap": Object { + "obj": Object { + "$ref": 0, + }, }, - }, - Object { - "$id": 5, - "from": Object { + "variableScope": Object { "$ref": 8, }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + ], + "name": "obj", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 54, - 56, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "$ref": 2, }, Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 71, - 73, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, + "$ref": 4, }, - ], - "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 5, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "global", "upperScope": null, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, - "variables": Array [ + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` +Object { + "$id": 18, + "block": Object { + "range": Array [ + 0, + 165, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 17, + "block": Object { + "range": Array [ + 0, + 165, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { + "$id": 16, + "block": Object { "range": Array [ - 0, - 34, + 25, + 164, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s1", - "range": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "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, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 125, + 128, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 130, + 143, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 140, + 143, + ], + "type": "Identifier", + }, + "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, + }, + ], + "throughReferences": Array [ + Object { + "$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, + }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object { + "T": Object { + "$ref": 3, + }, + }, + "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": true, + "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", + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + "obj": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 17, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "obj", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 24, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 24, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "obj", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "obj", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 15, + }, + ], + "scope": Object { + "$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, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + ], + "type": "global", + "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": 4, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 11, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 11, + 20, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + ], + "name": "f", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 62, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 62, + ], + "type": "Program", + }, + "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", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "T": Object { + "$ref": 2, + }, + "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", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "g": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "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, + "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/typeof-in-var.ts 1`] = ` +Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 147, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 147, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 22, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj2", + "range": Array [ + 27, + 43, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 46, + 58, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "value", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": Object { + "range": Array [ + 87, + 99, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 132, + 146, + ], + "type": "ArrayExpression", + }, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 123, + 126, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "element": Object { + "$ref": 3, + }, + "obj": Object { + "$ref": 0, + }, + "obj2": Object { + "$ref": 1, + }, + "value": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + ], + "name": "obj", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "obj2", + "range": Array [ + 27, + 43, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 58, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 23, + 58, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "obj2", + "range": Array [ + 27, + 43, + ], + "type": "Identifier", + }, + ], + "name": "obj2", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "value", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 63, + 99, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 59, + 99, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "value", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + ], + "name": "value", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 104, + 146, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 100, + 146, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + ], + "name": "element", + "references": Array [ + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ + 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": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 19, + ], + "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", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 47, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 47, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 46, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 45, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 13, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 13, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 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", + "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, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 11, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-infer.ts 1`] = ` +Object { + "$id": 15, + "block": Object { + "range": Array [ + 0, + 147, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 14, + "block": Object { + "range": Array [ + 0, + 147, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 13, + "block": Object { + "range": Array [ + 0, + 146, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "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, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 75, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 79, + 80, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$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", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 119, + 120, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + 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", + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "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", + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Unpacked": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 14, + }, + "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, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "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", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "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", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "LinkedList": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "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", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "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": 2, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "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", + "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": "map", + "range": Array [ + 4, + 35, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 35, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 36, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "map", + "range": Array [ + 4, + 35, + ], + "type": "Identifier", + }, + ], + "name": "map", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 47, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 47, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "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", + "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": "map", + "range": Array [ + 4, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 46, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "map", + "range": Array [ + 4, + 45, + ], + "type": "Identifier", + }, + ], + "name": "map", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 48, + ], + "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 { + "$ref": 1, + }, + ], + "type": "module", + "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": "map", + "range": Array [ + 4, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 46, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 47, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "map", + "range": Array [ + 4, + 46, + ], + "type": "Identifier", + }, + ], + "name": "map", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-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 { + "$ref": 1, + }, + ], + "type": "module", + "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": "map", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "map", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + ], + "name": "map", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 81, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 81, + ], + "type": "Program", + }, + "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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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, + "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-parenthesized-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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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", + "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 [ + 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", + "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, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 8, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 9, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-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", + "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", + "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", + "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", + "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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 31, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 31, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 32, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 31, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-empty.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 11, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 11, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 10, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 9, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-optional.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-rest.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 28, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` +Object { + "$id": 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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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", + "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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "obj": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "obj", + "range": Array [ + 4, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 23, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "obj", + "range": Array [ + 4, + 22, + ], + "type": "Identifier", + }, + ], + "name": "obj", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-operator.src.ts 1`] = ` +Object { + "$id": 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", + "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", + "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", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 17, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 17, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-intersection.src.ts 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 161, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 161, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "intersection": Object { + "$ref": 1, + }, + "precedence1": Object { + "$ref": 2, + }, + "precedence2": Object { + "$ref": 3, + }, + "union": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "union", + "range": Array [ + 4, + 36, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 36, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 37, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "union", + "range": Array [ + 4, + 36, + ], + "type": "Identifier", + }, + ], + "name": "union", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "intersection", + "range": Array [ + 42, + 71, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 42, + 71, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 38, + 72, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "intersection", + "range": Array [ + 42, + 71, + ], + "type": "Identifier", + }, + ], + "name": "intersection", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "precedence1", + "range": Array [ + 77, + 115, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 77, + 115, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 73, + 116, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "precedence1", + "range": Array [ + 77, + 115, + ], + "type": "Identifier", + }, + ], + "name": "precedence1", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "precedence2", + "range": Array [ + 121, + 159, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 121, + 159, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 117, + 160, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "precedence2", + "range": Array [ + 121, + 159, + ], + "type": "Identifier", + }, + ], + "name": "precedence2", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` +Object { + "$id": 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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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", + "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", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "bar": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 51, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 51, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/abstract-class.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 69, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 68, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 68, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 68, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-implements.ts 1`] = ` +Object { + "$id": 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 [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 6, + "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, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Component", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Nullable", + "range": Array [ + 41, + 49, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "SomeOther", + "range": Array [ + 50, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Component2", + "range": Array [ + 67, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + "Nullable": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 0, + "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": 3, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + 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": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "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", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "A": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 62, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 18, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + "s": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 18, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "s", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 62, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-supper-type.ts 1`] = ` +Object { + "$id": 15, + "block": Object { + "range": Array [ + 0, + 117, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 9, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 9, + "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": 10, + }, + }, + ], + }, + Object { + "$id": 12, + "block": Object { + "range": Array [ + 42, + 82, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo2": Object { + "$ref": 11, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 11, + "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": 12, + }, + }, + ], + }, + Object { + "$id": 14, + "block": Object { + "range": Array [ + 84, + 116, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo3": Object { + "$ref": 13, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 13, + "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": "Baz", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 69, + 72, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 107, + 110, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "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": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], + "type": "global", + "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": undefined, + "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": undefined, + "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": undefined, + "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 [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "Bar": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 3, + "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, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "Bar": Object { + "$ref": 1, + }, + "T": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "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": 5, + }, + }, + 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": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "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", + "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", + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 2, + }, + "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": undefined, + "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": undefined, + "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", + "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", + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 2, + }, + "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": undefined, + "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": undefined, + "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", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 19, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 19, + 28, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "f", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "f", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "f", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "f", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` +Object { + "$id": 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", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, + }, + "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", + "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": undefined, + "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", + "upperScope": null, + "variableMap": Object { + "C": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 25, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 34, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 21, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 25, + 34, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 2, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-module.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 95, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 33, + 92, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 89, + 90, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "a": Object { + "$ref": 3, + }, + "b": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 52, + 61, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 52, + 61, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 46, + 61, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 52, + 61, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "b", + "range": Array [ + 79, + 90, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 79, + 90, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 73, + 90, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "b", + "range": Array [ + 79, + 90, + ], + "type": "Identifier", + }, + ], + "name": "b", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 11, + ], + "type": "Literal", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 93, + 94, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "a": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ 6, - 8, + 7, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 65, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 40, + 62, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 65, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 40, + 62, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "test": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 46, + 58, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 62, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 46, + 58, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 60, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 15, + 59, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 40, + 57, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 59, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 59, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 15, + 81, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 40, + 79, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "test": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 63, + 75, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 79, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 63, + 75, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 81, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 81, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 15, + 69, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 40, + 67, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "test": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 49, + 53, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 67, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 49, + 53, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 69, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 69, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorators.ts 1`] = ` +Object { + "$id": 18, + "block": Object { + "range": Array [ + 0, + 198, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, + }, + "target": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "target", + "range": Array [ + 13, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "target", + "range": Array [ + 13, + 24, + ], + "type": "Identifier", + }, + ], + "name": "target", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 30, + 100, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "propertyKey": Object { + "$ref": 9, + }, + "target": Object { + "$ref": 8, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "target", + "range": Array [ + 59, + 70, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "target", + "range": Array [ + 59, + 70, + ], + "type": "Identifier", + }, + ], + "name": "target", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + Object { + "$id": 9, + "defs": Array [ + Object { + "name": Object { + "name": "propertyKey", + "range": Array [ + 72, + 91, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "propertyKey", + "range": Array [ + 72, + 91, + ], + "type": "Identifier", + }, + ], + "name": "propertyKey", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 7, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + Object { + "$id": 17, + "block": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 16, + "block": Object { + "range": Array [ + 159, + 195, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 15, + }, + }, + "variableScope": Object { + "$ref": 16, + }, + "variables": Array [ + Object { + "$id": 15, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 16, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "gec", + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "gec", + "range": Array [ + 147, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "C": Object { + "$ref": 12, + }, + }, + "variableScope": Object { + "$ref": 18, + }, + "variables": Array [ + Object { + "$id": 12, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 17, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 18, + }, + "identifier": Object { + "name": "dec", + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "C": Object { + "$ref": 2, + }, + "dec": Object { + "$ref": 0, + }, + "gec": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 18, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "dec", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "dec", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + ], + "name": "dec", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 18, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "gec", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 30, + 100, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "gec", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + ], + "name": "gec", + "references": Array [ + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$ref": 18, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 18, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/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", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, + }, + "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", + }, ], - "type": "Identifier", - }, - ], - "name": "s1", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, + "name": "subject", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, }, ], - "scope": Object { - "$ref": 8, - }, }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "eachr": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "s2", + "name": "eachr", "range": Array [ - 21, - 23, + 9, + 14, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 34, + 69, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s2", + "name": "eachr", "range": Array [ - 21, - 23, + 9, + 14, ], "type": "Identifier", }, ], - "name": "s2", - "references": Array [ + "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": 4, + "$ref": 7, }, Object { - "$ref": 7, + "$ref": 9, }, ], - "scope": Object { - "$ref": 8, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 107, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", + "type": "enum", + "upperScope": Object { + "$ref": 14, }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, + "variableMap": Object { + "A": Object { + "$ref": 3, + }, + "B": Object { + "$ref": 4, + }, + "C": Object { + "$ref": 5, + }, }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", + "variableScope": Object { + "$ref": 14, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "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": 6, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 14, }, "identifier": Object { - "name": "s1", + "name": "a", "range": Array [ - 51, - 53, + 6, + 15, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { "$ref": 0, }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", + "writeExpr": Object { "range": Array [ - 68, - 70, + 18, + 19, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "type": "Literal", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, }, ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { + "E": Object { "$ref": 1, }, + "a": Object { + "$ref": 0, + }, }, "variableScope": Object { - "$ref": 8, + "$ref": 14, }, "variables": Array [ Object { @@ -14553,10 +23975,10 @@ Object { "defs": Array [ Object { "name": Object { - "name": "s1", + "name": "a", "range": Array [ 6, - 8, + 15, ], "type": "Identifier", }, @@ -14570,7 +23992,7 @@ Object { "parent": Object { "range": Array [ 0, - 34, + 19, ], "type": "VariableDeclaration", }, @@ -14580,255 +24002,81 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s1", + "name": "a", "range": Array [ 6, - 8, + 15, ], "type": "Identifier", }, ], - "name": "s1", + "name": "a", "references": Array [ Object { "$ref": 2, }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, Object { "$ref": 7, }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, + "$ref": 9, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, + ], + "scope": Object { + "$ref": 14, + }, }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "f", + "name": "E", "range": Array [ - 17, - 18, + 25, + 26, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 37, + 20, + 70, ], - "type": "TSDeclareFunction", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "FunctionName", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "E", "range": Array [ - 17, - 18, + 25, + 26, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "E", + "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 14, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum-string.ts 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 70, + 29, ], "type": "Program", }, @@ -14838,9 +24086,9 @@ Object { "block": Object { "range": Array [ 0, - 69, + 28, ], - "type": "TSDeclareFunction", + "type": "TSEnumDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, @@ -14852,27 +24100,33 @@ Object { "$ref": 3, }, "identifier": Object { - "name": "subject", + "name": "BAR", "range": Array [ - 61, - 68, + 15, + 18, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { "$ref": 1, }, - "writeExpr": undefined, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "Literal", + }, }, ], "throughReferences": Array [], - "type": "empty-function", + "type": "enum", "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "subject": Object { + "BAR": Object { "$ref": 1, }, }, @@ -14885,36 +24139,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "subject", + "name": "BAR", "range": Array [ - 27, - 51, + 15, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 69, + 15, + 26, ], - "type": "TSDeclareFunction", + "type": "TSEnumMember", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "EnumMemberName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "subject", + "name": "BAR", "range": Array [ - 27, - 51, + 15, + 18, ], "type": "Identifier", }, ], - "name": "subject", + "name": "BAR", "references": Array [ Object { "$ref": 2, @@ -14934,7 +24188,7 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { - "eachr": Object { + "Foo": Object { "$ref": 0, }, }, @@ -14947,36 +24201,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "eachr", + "name": "Foo", "range": Array [ - 9, - 14, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 69, + 28, ], - "type": "TSDeclareFunction", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "FunctionName", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "eachr", + "name": "Foo", "range": Array [ - 9, - 14, + 5, + 8, ], "type": "Identifier", }, ], - "name": "eachr", + "name": "Foo", "references": Array [], "scope": Object { "$ref": 4, @@ -14986,13 +24240,13 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-global.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, - 55, + 23, ], "type": "Program", }, @@ -15001,315 +24255,320 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { - "name": "C", + "name": "a", "range": Array [ - 38, - 39, + 20, + 21, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "type": "Literal", - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { + "throughReferences": Array [ + Object { "$ref": 0, }, - }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "variables": Array [ + "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, - "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, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, }, ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-module.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` Object { - "$id": 7, + "$id": 16, "block": Object { "range": Array [ 0, - 95, + 67, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { "$id": 6, - "block": Object { + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", "range": Array [ - 33, - 92, + 32, + 35, ], - "type": "TSModuleBlock", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 89, - 90, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 7, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, }, - "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "b": Object { - "$ref": 4, - }, + "identifier": Object { + "name": "foo", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 7, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 16, }, - "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, - }, - }, - ], + "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, }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ Object { - "$id": 1, + "$id": 13, "from": Object { - "$ref": 7, + "$ref": 16, }, "identifier": Object { - "name": "a", + "name": "d", "range": Array [ - 6, - 7, + 57, + 58, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 3, }, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "e", "range": Array [ - 10, - 11, + 60, + 61, ], - "type": "Literal", + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, }, + "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 15, "from": Object { - "$ref": 7, + "$ref": 16, }, "identifier": Object { - "name": "a", + "name": "f", "range": Array [ - 93, - 94, + 63, + 64, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 5, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + ], "type": "global", "upperScope": null, "variableMap": Object { "a": Object { "$ref": 0, }, + "b": Object { + "$ref": 1, + }, + "c": Object { + "$ref": 2, + }, + "d": Object { + "$ref": 3, + }, + "e": Object { + "$ref": 4, + }, + "f": Object { + "$ref": 5, + }, }, "variableScope": Object { - "$ref": 7, + "$ref": 16, }, "variables": Array [ Object { @@ -15327,14 +24586,14 @@ Object { "node": Object { "range": Array [ 6, - 11, + 7, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 11, + 22, ], "type": "VariableDeclaration", }, @@ -15355,882 +24614,614 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 16, + }, }, - }, - "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, - 64, + 9, + 10, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "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-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 [ + "$id": 2, + "defs": Array [ Object { - "$id": 5, - "block": Object { + "name": Object { + "name": "c", "range": Array [ - 40, - 62, + 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 [ - 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": "Variable", }, ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ + "eslintUsed": undefined, + "identifiers": 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": "c", + "range": Array [ + 12, + 13, ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, + "type": "Identifier", + }, + ], + "name": "c", + "references": Array [ + Object { + "$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, - 64, + 16, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "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-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 [ + "$id": 4, + "defs": Array [ Object { - "$id": 4, - "block": Object { + "name": Object { + "name": "e", "range": Array [ - 40, - 57, + 18, + 19, ], - "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, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, + "node": Object { + "range": Array [ + 18, + 19, + ], + "type": "VariableDeclarator", }, - "variableScope": Object { - "$ref": 4, + "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": 4, - }, - }, - ], + "type": "Variable", }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 3, + "name": "e", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", }, ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "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, - 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, - }, + "$ref": 14, }, ], + "scope": Object { + "$ref": 16, + }, }, - ], - "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": 5, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "f", "range": Array [ 21, - 24, + 22, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 59, + 21, + 22, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "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": 6, + "$ref": 16, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload.ts 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 82, + 101, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ - 15, - 81, + 0, + 18, ], - "type": "ClassDeclaration", + "type": "TSDeclareFunction", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { + "range": Array [ + 19, + 46, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ Object { - "$id": 5, - "block": Object { - "range": Array [ - 40, - 79, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "$id": 2, + "defs": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", + "name": Object { + "name": "a", "range": Array [ - 42, - 45, + 30, + 39, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "node": Object { + "range": Array [ + 19, + 46, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", }, ], - "throughReferences": Array [ + "eslintUsed": true, + "identifiers": Array [ Object { - "$ref": 4, + "name": "a", + "range": Array [ + 30, + 39, + ], + "type": "Identifier", }, ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 3, }, - "variableScope": Object { - "$ref": 5, + }, + ], + }, + Object { + "$id": 6, + "block": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "a": Object { + "$ref": 5, + }, + "arguments": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, }, - "variables": Array [ + }, + Object { + "$id": 5, + "defs": Array [ Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, + "name": Object { + "name": "a", + "range": Array [ + 58, + 68, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionDeclaration", }, + "parent": null, + "type": "Parameter", }, - 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", - }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 58, + 68, ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, + "type": "Identifier", }, ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 6, + }, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$ref": 4, + "name": Object { + "name": "f", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", }, ], - "type": "class", - "upperScope": Object { + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "f", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + ], + "name": "f", + "references": Array [], + "scope": Object { "$ref": 7, }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 47, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { + "range": Array [ + 19, + 46, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 4, + }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 81, + 19, + 46, ], - "type": "ClassDeclaration", + "type": "TSDeclareFunction", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 30, + 39, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "a", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], @@ -16239,20 +25230,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { - "Foo": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -16260,52 +25247,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "f", "range": Array [ - 21, - 24, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 81, + 0, + 18, ], - "type": "ClassDeclaration", + "type": "TSDeclareFunction", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "f", "range": Array [ - 21, - 24, + 9, + 10, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "f", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 70, + 65, ], "type": "Program", }, @@ -16314,8 +25301,8 @@ Object { "$id": 6, "block": Object { "range": Array [ - 15, - 69, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -16324,8 +25311,8 @@ Object { "$id": 5, "block": Object { "range": Array [ - 40, - 67, + 35, + 62, ], "type": "FunctionExpression", }, @@ -16339,10 +25326,10 @@ Object { "$ref": 5, }, "identifier": Object { - "name": "Dec", + "name": "Decorator", "range": Array [ - 42, - 45, + 37, + 46, ], "type": "Identifier", }, @@ -16364,7 +25351,7 @@ Object { "arguments": Object { "$ref": 2, }, - "test": Object { + "config": Object { "$ref": 3, }, }, @@ -16388,17 +25375,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "test", + "name": "config", "range": Array [ - 49, + 47, 53, ], "type": "Identifier", }, "node": Object { "range": Array [ - 40, - 67, + 35, + 62, ], "type": "FunctionExpression", }, @@ -16409,15 +25396,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "test", + "name": "config", "range": Array [ - 49, + 47, 53, ], "type": "Identifier", }, ], - "name": "test", + "name": "config", "references": Array [], "scope": Object { "$ref": 5, @@ -16439,7 +25426,7 @@ Object { "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "Test": Object { "$ref": 1, }, }, @@ -16452,17 +25439,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "Test", "range": Array [ - 21, - 24, + 13, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 69, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -16473,15 +25460,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "Test", "range": Array [ - 21, - 24, + 13, + 17, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "Test", "references": Array [], "scope": Object { "$ref": 6, @@ -16501,7 +25488,7 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { - "Foo": Object { + "Test": Object { "$ref": 0, }, }, @@ -16514,17 +25501,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "Test", "range": Array [ - 21, - 24, + 13, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 69, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -16535,15 +25522,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "Test", "range": Array [ - 21, - 24, + 13, + 17, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "Test", "references": Array [], "scope": Object { "$ref": 7, @@ -16553,429 +25540,223 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorators.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 18, + "$id": 13, "block": Object { "range": Array [ 0, - 198, + 115, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, - 29, + 15, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "target": Object { - "$ref": 5, - }, + "$ref": 13, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 13, }, - "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, - }, - }, - ], + "variables": Array [], }, Object { - "$id": 11, + "$id": 7, "block": Object { "range": Array [ - 30, - 100, + 16, + 44, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, - "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", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ + "references": Array [ Object { - "$id": 7, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 11, + "$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", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], }, Object { - "$id": 17, + "$id": 12, "block": Object { "range": Array [ - 102, - 197, + 45, + 104, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "$id": 16, - "block": Object { + "$id": 8, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "B", "range": Array [ - 159, - 195, + 65, + 66, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 17, + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "variableMap": Object { - "arguments": Object { - "$ref": 15, - }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 12, }, - "variableScope": Object { - "$ref": 16, + "identifier": Object { + "name": "a", + "range": Array [ + 80, + 91, + ], + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 15, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 16, - }, - }, - ], + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 13, + "$id": 10, "from": Object { - "$ref": 17, + "$ref": 12, }, "identifier": Object { - "name": "gec", + "name": "A", "range": Array [ - 122, - 125, + 88, + 89, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 0, }, "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 11, "from": Object { - "$ref": 17, + "$ref": 12, }, "identifier": Object { - "name": "gec", + "name": "A", "range": Array [ - 147, - 150, + 99, + 100, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 0, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 13, + "$ref": 8, }, Object { - "$ref": 14, + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, }, ], - "type": "class", + "type": "interface", "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "C": Object { - "$ref": 12, - }, + "$ref": 13, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 18, + "$ref": 13, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 18, + "$ref": 13, }, "identifier": Object { - "name": "dec", + "name": "C", "range": Array [ - 103, - 106, + 113, + 114, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 2, }, "writeExpr": undefined, }, @@ -16984,18 +25765,21 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { - "C": Object { - "$ref": 2, - }, - "dec": Object { + "A": Object { "$ref": 0, }, - "gec": Object { + "B": Object { "$ref": 1, }, + "C": Object { + "$ref": 2, + }, + "a": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 18, + "$ref": 13, }, "variables": Array [ Object { @@ -17003,281 +25787,343 @@ Object { "defs": Array [ Object { "name": Object { - "name": "dec", + "name": "A", "range": Array [ - 9, - 12, + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 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 [ + Object { + "$ref": 6, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 26, + 27, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 29, + 16, + 44, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "dec", + "name": "B", "range": Array [ - 9, - 12, + 26, + 27, ], "type": "Identifier", }, ], - "name": "dec", + "name": "B", "references": Array [ Object { - "$ref": 3, + "$ref": 8, }, ], "scope": Object { - "$ref": 18, + "$ref": 13, }, }, Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "gec", + "name": "C", "range": Array [ - 39, - 42, + 55, + 56, ], "type": "Identifier", }, "node": Object { "range": Array [ - 30, - 100, + 45, + 104, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "gec", + "name": "C", "range": Array [ - 39, - 42, + 55, + 56, ], "type": "Identifier", }, ], - "name": "gec", + "name": "C", "references": Array [ Object { - "$ref": 13, - }, - Object { - "$ref": 14, + "$ref": 4, }, ], "scope": Object { - "$ref": 18, + "$ref": 13, }, }, Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "a", "range": Array [ - 113, + 110, 114, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 110, + 114, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 106, + 114, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "a", "range": Array [ - 113, + 110, 114, ], "type": "Identifier", }, ], - "name": "C", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 18, + "$ref": 13, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-equals.ts 1`] = ` Object { - "$id": 14, + "$id": 1, "block": Object { "range": Array [ 0, - 71, + 28, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 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, - }, + "$id": 0, + "defs": Array [ Object { - "$id": 8, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "B", + "name": Object { + "name": "foo", "range": Array [ - 44, - 45, + 7, + 10, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { + "node": Object { "range": Array [ - 48, - 53, + 0, + 27, ], - "type": "BinaryExpression", + "type": "TSImportEqualsDeclaration", }, + "parent": null, + "type": "ImportBinding", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ 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, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` +Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/interface-type.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], + }, + Object { + "$id": 6, + "block": Object { + "range": Array [ + 27, + 66, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "$id": 10, + "$id": 5, "from": Object { - "$ref": 13, + "$ref": 6, }, "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, @@ -17286,240 +26132,66 @@ Object { }, "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, + "$ref": 1, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 7, - }, - Object { - "$ref": 9, + "$ref": 5, }, ], - "type": "enum", + "type": "interface", "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "A": Object { - "$ref": 3, - }, - "B": Object { - "$ref": 4, - }, - "C": Object { - "$ref": 5, - }, + "$ref": 7, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 7, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 14, + "$ref": 7, }, "identifier": Object { - "name": "a", + "name": "C", "range": Array [ - 6, - 15, + 49, + 50, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 19, - ], - "type": "Literal", + "$ref": 1, }, + "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { - "E": Object { + "C": Object { "$ref": 1, }, - "a": Object { + "R": Object { + "$ref": 2, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 7, }, "variables": Array [ Object { @@ -17527,207 +26199,230 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "T", "range": Array [ - 6, - 15, + 12, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 19, + 11, + 20, ], - "type": "VariableDeclarator", + "type": "TSTypeParameterDeclaration", }, - "parent": Object { + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "T", "range": Array [ - 0, - 19, + 39, + 40, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "node": Object { + "range": Array [ + 38, + 51, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "T", "range": Array [ - 6, - 15, + 12, + 13, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 39, + 40, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { - "$ref": 2, + "name": Object { + "name": "C", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", }, + ], + "name": "C", + "references": Array [ Object { - "$ref": 7, + "$ref": 3, }, Object { - "$ref": 9, + "$ref": 5, }, ], "scope": Object { - "$ref": 14, + "$ref": 7, }, }, Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "E", + "name": "R", "range": Array [ - 25, - 26, + 37, + 38, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 70, + 27, + 66, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "E", + "name": "R", "range": Array [ - 25, - 26, + 37, + 38, ], "type": "Identifier", }, ], - "name": "E", + "name": "R", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 7, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum-string.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 29, + 143, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ - 0, 28, + 142, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { - "name": "BAR", + "name": "text", "range": Array [ - 15, - 18, + 116, + 120, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "Literal", + "$ref": 0, }, + "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "enum", + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { - "BAR": Object { - "$ref": 1, + "arguments": Object { + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "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", - }, - ], + "$id": 3, + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "BAR", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "BAR", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "identifiers": Array [], + "name": "arguments", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -17735,17 +26430,46 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "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": "global", "upperScope": null, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "text": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { @@ -17753,334 +26477,373 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "text", "range": Array [ - 5, - 8, + 6, + 10, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 28, + 20, ], - "type": "TSEnumDeclaration", + "type": "VariableDeclaration", }, - "parent": undefined, - "type": "EnumName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "text", "range": Array [ - 5, - 8, + 6, + 10, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "text", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-as.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` -Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "$ref": 6, }, - "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, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 28, + 142, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, }, - "writeExpr": undefined, }, + ], +} +`; + +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": 10, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "baz", + "block": Object { "range": Array [ - 48, - 51, + 19, + 123, ], - "type": "Identifier", + "type": "ClassDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 14, + "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", + "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": 5, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 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": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 11, }, - "identifier": Object { - "name": "d", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", + "variableMap": Object { + "A": Object { + "$ref": 4, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 3, + "variableScope": Object { + "$ref": 11, }, - "writeExpr": undefined, + "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": 10, + }, + }, + ], }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "$id": 12, + "$id": 2, "from": Object { - "$ref": 14, + "$ref": 11, }, "identifier": Object { - "name": "e", + "name": "s", "range": Array [ - 60, - 61, + 6, + 7, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 4, + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 18, + ], + "type": "CallExpression", }, - "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 3, "from": Object { - "$ref": 14, + "$ref": 11, }, "identifier": Object { - "name": "f", + "name": "Symbol", "range": Array [ - 63, - 64, + 10, + 16, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 5, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 6, + "$ref": 3, }, Object { - "$ref": 10, + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { + "A": Object { "$ref": 1, }, - "c": Object { - "$ref": 2, - }, - "d": Object { - "$ref": 3, - }, - "e": Object { - "$ref": 4, - }, - "f": Object { - "$ref": 5, + "s": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 11, }, "variables": Array [ Object { @@ -18088,7 +26851,7 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "s", "range": Array [ 6, 7, @@ -18098,214 +26861,14 @@ Object { "node": Object { "range": Array [ 6, - 7, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "name": "d", - "references": Array [ - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ 18, - 19, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, + 18, ], "type": "VariableDeclaration", }, @@ -18315,279 +26878,161 @@ Object { "eslintUsed": undefined, "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, "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", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, + "type": "Identifier", }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, + "kind": "w", + "resolved": Object { + "$ref": 0, }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { + "writeExpr": Object { "range": Array [ - 19, - 46, + 12, + 13, ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, + "type": "Literal", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], }, Object { - "$id": 6, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 47, - 100, + 24, + 27, ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, + "type": "Identifier", }, - "variableMap": Object { - "a": Object { - "$ref": 5, - }, - "arguments": Object { - "$ref": 4, - }, + "kind": "r", + "resolved": Object { + "$ref": 0, }, - "variableScope": Object { - "$ref": 6, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, }, - "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, - }, - }, - ], + "identifier": Object { + "name": "test", + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { - "f": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -18595,145 +27040,192 @@ 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, "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", "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 +27233,84 @@ 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", "upperScope": null, "variableMap": Object { - "f": Object { + "N": Object { + "$ref": 1, + }, + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { @@ -18759,231 +27318,196 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "a", "range": Array [ - 9, - 10, + 6, + 7, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 18, + 11, ], - "type": "TSDeclareFunction", + "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": "FunctionName", + "type": "NamespaceName", }, ], "eslintUsed": undefined, "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/parameter-property.ts 1`] = `"ImportDeclaration should appear when the mode is ES6 and in the module context."`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/parameter-property-simple.ts 1`] = `"ImportDeclaration should appear when the mode is ES6 and in the module context."`; + +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", "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 [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Test", + "name": "args", "range": Array [ - 13, - 17, + 16, + 20, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 64, + 0, + 34, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Test", + "name": "args", "range": Array [ - 13, - 17, + 16, + 20, ], "type": "Identifier", }, ], - "name": "Test", + "name": "args", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], @@ -18992,20 +27516,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { - "Test": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -19013,132 +27533,81 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Test", + "name": "foo", "range": Array [ - 13, - 17, + 9, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 64, + 0, + 34, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Test", + "name": "foo", "range": Array [ - 13, - 17, + 9, + 12, ], "type": "Identifier", }, ], - "name": "Test", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/ignore-type-only-stuff.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, - 115, + 18, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ + "childScopes": 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", + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, "references": Array [], - "scope": Object { - "$ref": 1, + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, }, + "variables": Array [], }, ], -} -`; - -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 [], @@ -19151,7 +27620,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -19161,20 +27630,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 +27651,8 @@ Object { Object { "name": "foo", "range": Array [ - 7, - 10, + 5, + 8, ], "type": "Identifier", }, @@ -19191,134 +27660,250 @@ 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", + "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, - }, - "identifier": Object { - "name": "text", + "$id": 10, + "block": Object { "range": Array [ - 116, - 120, + 47, + 100, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "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, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 11, }, - "writeExpr": undefined, + "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": 4, + "$ref": 8, + }, + Object { + "$ref": 9, }, ], - "type": "function", + "type": "class", "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,69 +27913,116 @@ 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", + "kind": "r", "resolved": Object { "$ref": 0, }, - "writeExpr": Object { - "range": Array [ - 13, - 19, - ], - "type": "Literal", - }, + "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { - "Foo": Object { + "A": Object { + "$ref": 0, + }, + "C": Object { + "$ref": 2, + }, + "a": Object { "$ref": 1, }, - "text": Object { - "$ref": 0, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 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 [ + Object { + "$ref": 3, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 12, + }, }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "text", + "name": "a", "range": Array [ - 6, - 10, + 20, + 31, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 19, + 20, + 31, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 0, - 20, + 16, + 31, ], "type": "VariableDeclaration", }, @@ -19400,298 +28032,195 @@ Object { "eslintUsed": undefined, "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, "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", "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 10, + "$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, - 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, - }, - }, - ], + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 10, + "$ref": 8, }, "identifier": Object { - "name": "s", + "name": "a", "range": Array [ - 6, - 7, + 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 [ - 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", }, @@ -19699,24 +28228,49 @@ Object { "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": "global", "upperScope": null, "variableMap": Object { "A": Object { - "$ref": 1, - }, - "s": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [ Object { @@ -19724,244 +28278,224 @@ 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, + 16, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s", + "name": "A", "range": Array [ + 5, 6, - 7, ], "type": "Identifier", }, ], - "name": "s", + "name": "A", "references": Array [ Object { "$ref": 2, }, Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", + "$ref": 6, }, ], - "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", "upperScope": Object { - "$ref": 9, + "$ref": 4, }, "variableMap": Object { - "a": Object { - "$ref": 5, + "T": Object { + "$ref": 2, + }, + "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", + "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": undefined, + "identifiers": Array [ + Object { + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, ], + "name": "f", + "references": Array [], + "scope": Object { + "$ref": 4, + }, }, ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/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 +28512,43 @@ 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", "upperScope": null, "variableMap": Object { - "N": Object { - "$ref": 1, - }, "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 3, }, "variables": Array [ Object { @@ -20052,99 +28566,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", + "type": "Variable", }, ], "eslintUsed": undefined, "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 +28621,42 @@ 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", "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "args": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -20190,57 +28676,21 @@ 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", "upperScope": null, "variableMap": Object { - "foo": Object { + "test": Object { "$ref": 0, }, }, @@ -20253,251 +28703,147 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "test", "range": Array [ 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-alias.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 103, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 4, - }, - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 30, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 9, + 13, ], + "type": "Identifier", }, ], - "functionExpressionScope": false, - "isStrict": true, + "name": "test", "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "C": Object { - "$ref": 2, - }, + "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", + "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 { + "B": Object { "$ref": 1, }, - "a": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { @@ -20505,24 +28851,24 @@ 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", }, @@ -20532,18 +28878,25 @@ Object { "eslintUsed": undefined, "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 +28904,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,15 +28958,40 @@ 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", }, @@ -20621,22 +28999,41 @@ Object { "resolved": null, "writeExpr": Object { "range": Array [ - 21, - 26, + 27, + 40, ], "type": "TSTypeAssertion", }, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$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 [ - 25, - 26, + 39, + 40, ], "type": "Identifier", }, @@ -20645,15 +29042,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 +29058,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 +29081,491 @@ 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", "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": undefined, + "identifiers": Array [ + Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + ], + "name": "obj", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/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", + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object { + "T": Object { + "$ref": 3, + }, + }, + "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, + }, + }, + ], }, ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 17, }, "identifier": Object { - "name": "a", + "name": "obj", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, @@ -20853,23 +29575,39 @@ 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", "upperScope": null, "variableMap": Object { - "a": Object { + "A": Object { + "$ref": 1, + }, + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 17, }, "variables": Array [ Object { @@ -20877,24 +29615,24 @@ 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", }, @@ -20904,97 +29642,218 @@ Object { "eslintUsed": undefined, "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", + "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", "upperScope": null, "variableMap": Object { - "obj": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -21002,239 +29861,243 @@ 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, "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, - }, - 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", - }, - }, + "childScopes": Array [ 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", + "block": Object { "range": Array [ - 58, + 0, 61, ], - "type": "Identifier", + "type": "FunctionDeclaration", }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "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", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "T": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, + "g": Object { + "$ref": 3, + }, }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, + "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": false, + "references": Array [], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { - "obj": Object { + "g": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -21242,68 +30105,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, "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 +30159,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 +30177,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 +30228,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 +30272,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": "w", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 132, + 146, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "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", }, @@ -21455,12 +30320,21 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { + "element": Object { + "$ref": 3, + }, "obj": Object { "$ref": 0, }, + "obj2": Object { + "$ref": 1, + }, + "value": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 8, + "$ref": 11, }, "variables": Array [ Object { @@ -21470,22 +30344,22 @@ 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", }, @@ -21497,8 +30371,8 @@ Object { Object { "name": "obj", "range": Array [ - 6, - 9, + 4, + 7, ], "type": "Identifier", }, @@ -21506,152 +30380,210 @@ 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": undefined, + "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": undefined, + "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", }, - }, - 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, + "node": Object { + "range": Array [ + 104, + 146, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 100, + 146, + ], + "type": "VariableDeclaration", }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + ], + "name": "element", + "references": Array [ + Object { + "$ref": 9, }, ], + "scope": Object { + "$ref": 11, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` +Object { + "$id": 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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -21661,12 +30593,12 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { - "f": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -21674,164 +30606,132 @@ 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", + "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": undefined, + "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 [], @@ -21839,12 +30739,12 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { - "g": Object { + "x": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 1, }, "variables": Array [ Object { @@ -21852,52 +30752,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, "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,266 +30812,82 @@ 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, - }, - "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, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 2, "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", + "name": "T", "range": Array [ - 123, - 126, + 7, + 8, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "element": Object { - "$ref": 3, - }, - "obj": Object { - "$ref": 0, - }, - "obj2": Object { - "$ref": 1, - }, - "value": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, + ], + "throughReferences": Array [ Object { - "$id": 1, + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "obj2", + "name": "x", "range": Array [ - 27, - 43, + 4, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ - 27, - 58, + 4, + 11, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 23, - 58, + 0, + 12, ], "type": "VariableDeclaration", }, @@ -22175,177 +30897,371 @@ Object { "eslintUsed": undefined, "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 [ + 119, + 120, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + 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 [ - 104, - 146, + 144, + 145, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { - "range": Array [ - 100, - 146, - ], - "type": "VariableDeclaration", + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "type": "Variable", + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, }, - ], - "name": "element", - "references": Array [ Object { "$ref": 9, }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, ], - "scope": Object { - "$ref": 11, + "type": "type-alias", + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "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, + }, + }, + ], }, ], -} -`; - -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 { + "Unpacked": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 14, }, "variables": Array [ Object { @@ -22353,138 +31269,195 @@ 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 [ + 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 [ - 4, - 45, + 33, + 43, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", "range": Array [ - 4, + 44, 45, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { - "range": Array [ - 0, - 46, - ], - "type": "VariableDeclaration", + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "type": "Variable", + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "x", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", + "$ref": 3, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, + "type": "type-alias", + "upperScope": Object { + "$ref": 6, }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "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, + }, + }, + ], }, ], -} -`; - -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 [], @@ -22492,12 +31465,12 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { - "x": Object { + "LinkedList": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [ Object { @@ -22505,104 +31478,52 @@ 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", - "references": Array [], + "name": "LinkedList", + "references": Array [ + Object { + "$ref": 3, + }, + ], "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,8 +31534,30 @@ 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", "upperScope": null, "variableMap": Object { @@ -22623,7 +31566,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22669,7 +31612,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22678,7 +31621,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,8 +31632,30 @@ 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", "upperScope": null, "variableMap": Object { @@ -22699,7 +31664,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22745,7 +31710,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22754,7 +31719,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,8 +31730,30 @@ 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", "upperScope": null, "variableMap": Object { @@ -22775,7 +31762,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22821,7 +31808,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22830,7 +31817,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,8 +31828,30 @@ 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", "upperScope": null, "variableMap": Object { @@ -22851,7 +31860,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22897,7 +31906,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22906,7 +31915,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 +31923,94 @@ 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", + "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 {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "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 +32018,94 @@ 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", + "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 {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "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,8 +32116,30 @@ 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", "upperScope": null, "variableMap": Object { @@ -22977,7 +32148,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -23023,7 +32194,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -23032,7 +32203,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,8 +32214,30 @@ 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", "upperScope": null, "variableMap": Object { @@ -23053,7 +32246,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -23099,7 +32292,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -23108,7 +32301,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,8 +32312,50 @@ 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", "upperScope": null, "variableMap": Object { @@ -23129,7 +32364,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -23175,7 +32410,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -23488,7 +32723,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 +32731,88 @@ 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", + "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 {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "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, + }, + }, + ], } `; @@ -23589,7 +32894,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,8 +32905,30 @@ 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", "upperScope": null, "variableMap": Object { @@ -23613,7 +32940,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -23659,7 +32986,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, Object { @@ -23705,7 +33032,7 @@ Object { "name": "y", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -24035,7 +33362,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 +33370,87 @@ 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", + "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 {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "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..eade98ea309d 100644 --- a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap @@ -102,7 +102,7 @@ Object { exports[`TSX fixtures/react-typed-props.src 1`] = ` Object { - "$id": 7, + "$id": 10, "block": Object { "range": Array [ 0, @@ -112,7 +112,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -122,7 +122,31 @@ 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", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [], + }, + Object { + "$id": 8, "block": Object { "range": Array [ 80, @@ -135,9 +159,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 +192,45 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 5, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "function", "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 +266,11 @@ Object { "name": "props", "references": Array [ Object { - "$ref": 4, + "$ref": 7, }, ], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -235,10 +282,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 10, }, "variableMap": Object { "App": Object { + "$ref": 2, + }, + "Props": Object { "$ref": 1, }, "React": Object { @@ -246,7 +296,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [ Object { @@ -292,11 +342,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 +426,7 @@ Object { "name": "App", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 9, }, }, ], @@ -346,7 +440,7 @@ 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..5b61888a0183 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, @@ -37,15 +37,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -56,7 +59,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, }, }, ], @@ -68,7 +111,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -76,7 +119,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -116,7 +159,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -130,7 +173,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -138,7 +181,7 @@ Object { exports[`typescript fixtures/babylon-convergence/type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -148,7 +191,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -158,7 +201,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -173,15 +216,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -192,7 +238,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, }, }, ], @@ -204,7 +290,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -212,7 +298,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -252,7 +338,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -266,7 +352,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -439,7 +525,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 +535,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -459,7 +545,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -470,11 +556,33 @@ 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", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "AbstractSocket": Object { @@ -482,7 +590,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -522,7 +630,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -531,10 +639,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "AbstractSocket": Object { @@ -542,7 +654,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -582,7 +694,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -591,12 +703,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -1264,7 +1380,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 +1390,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -1284,7 +1400,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -1295,11 +1411,33 @@ 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", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "AbstractSocket": Object { @@ -1307,7 +1445,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -1347,7 +1485,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -1356,10 +1494,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "AbstractSocket": Object { @@ -1367,7 +1509,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -1407,7 +1549,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -1416,12 +1558,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -1429,7 +1575,7 @@ Object { exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -1439,7 +1585,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -1447,20 +1593,90 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "I": Object { + "$ref": 0, + }, }, - "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, @@ -1471,7 +1687,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -1979,7 +2195,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 +2205,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, @@ -1999,7 +2215,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2012,9 +2228,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,7 +2280,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 1, }, "writeExpr": undefined, }, @@ -2034,19 +2288,69 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 6, }, "variableMap": Object { - "b": Object { + "X": Object { "$ref": 0, }, + "b": Object { + "$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 +2386,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 1, + "$ref": 4, }, ], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -2098,11 +2402,11 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [], }, @@ -2115,7 +2419,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } @@ -2921,7 +3225,7 @@ Object { exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2931,7 +3235,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -2939,31 +3243,157 @@ 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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 5, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -2971,7 +3401,7 @@ Object { exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, @@ -2981,7 +3411,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2989,31 +3419,229 @@ 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", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "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", "upperScope": Object { - "$ref": 1, + "$ref": 6, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } @@ -3120,7 +3748,7 @@ Object { exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -3130,7 +3758,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -3145,7 +3773,7 @@ Object { Object { "$id": 0, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "x", @@ -3159,19 +3787,39 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -3183,12 +3831,15 @@ Object { Object { "$ref": 0, }, + Object { + "$ref": 1, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -4691,7 +5342,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 +5352,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -4711,7 +5362,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -4721,7 +5372,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 23, @@ -4736,15 +5387,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -4755,13 +5409,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, @@ -4776,26 +5470,69 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { + "T": Object { + "$ref": 6, + }, "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, }, }, ], @@ -4807,7 +5544,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "C": Object { @@ -4815,7 +5552,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -4855,7 +5592,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -4867,7 +5604,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -4875,7 +5612,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -4915,7 +5652,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -4929,7 +5666,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -5516,7 +6253,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 +6263,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5536,7 +6273,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5551,19 +6288,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "ClassWithParentAndInterface": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -5599,7 +6336,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -5611,7 +6348,24 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, + }, + "identifier": Object { + "name": "MyInterface", + "range": Array [ + 66, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 5, }, "identifier": Object { "name": "MyOtherClass", @@ -5630,10 +6384,13 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -5641,7 +6398,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -5681,7 +6438,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -5694,12 +6451,15 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -5707,7 +6467,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5717,7 +6477,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5727,7 +6487,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5742,19 +6502,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { - "$id": 2, + "$id": 4, "defs": Array [ Object { "name": Object { @@ -5790,7 +6550,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -5800,9 +6560,26 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, }, "identifier": Object { "name": "Bar", @@ -5819,24 +6596,70 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "A": Object { "$ref": 0, }, + "Foo": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { "$id": 0, + "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": 6, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -5872,7 +6695,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -5883,14 +6706,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [], } @@ -5898,7 +6724,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 +6734,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5918,7 +6744,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5933,19 +6759,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { - "$id": 2, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -5981,7 +6807,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -5991,9 +6817,60 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 8, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "D", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, }, "identifier": Object { "name": "Bar", @@ -6010,24 +6887,76 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object { - "Foo": Object { + "A": Object { "$ref": 0, }, + "Foo": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { "$id": 0, + "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": 8, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -6063,7 +6992,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -6074,14 +7003,23 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 9, }, "variables": Array [], } @@ -6089,7 +7027,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6099,7 +7037,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6109,7 +7047,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6119,7 +7057,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 20, @@ -6134,15 +7072,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -6153,7 +7094,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, }, }, ], @@ -6165,7 +7146,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -6173,7 +7154,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -6213,7 +7194,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -6225,7 +7206,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6233,7 +7214,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -6273,7 +7254,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -6287,7 +7268,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -6295,7 +7276,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 +7286,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6315,7 +7296,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6325,7 +7306,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 20, @@ -6336,19 +7317,44 @@ 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", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -6359,7 +7365,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 +7414,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6379,7 +7429,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -6419,7 +7469,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -6428,10 +7478,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -6439,7 +7493,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -6479,7 +7533,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -6488,12 +7542,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } @@ -6501,7 +7559,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6511,7 +7569,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -6521,7 +7579,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -6536,19 +7594,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -6584,7 +7642,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -6592,11 +7650,33 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -6604,7 +7684,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -6644,7 +7724,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -6653,12 +7733,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -6666,7 +7750,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 +7760,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6686,7 +7770,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -6701,19 +7785,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "ClassWithParentAndInterface": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -6749,7 +7833,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -6761,7 +7845,24 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, + }, + "identifier": Object { + "name": "MyInterface", + "range": Array [ + 45, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 5, }, "identifier": Object { "name": "MyOtherClass", @@ -6780,10 +7881,13 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -6791,7 +7895,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -6831,7 +7935,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -6844,12 +7948,15 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -6857,7 +7964,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6867,7 +7974,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6877,7 +7984,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -6892,19 +7999,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -6940,7 +8047,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -6948,11 +8055,53 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -6960,7 +8109,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -7000,7 +8149,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -7009,12 +8158,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -7022,7 +8178,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 +8188,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, @@ -7042,7 +8198,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -7057,19 +8213,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 6, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { - "$id": 1, + "$id": 4, "defs": Array [ Object { "name": Object { @@ -7105,7 +8261,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -7113,11 +8269,73 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -7125,7 +8343,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -7165,7 +8383,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -7174,12 +8392,22 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } @@ -7187,7 +8415,7 @@ Object { exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -7197,7 +8425,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -7207,7 +8435,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -7232,7 +8460,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -7257,7 +8485,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 35, @@ -7272,15 +8500,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { + "T": Object { + "$ref": 5, + }, "arguments": Object { "$ref": 4, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -7291,13 +8522,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, @@ -7312,26 +8583,26 @@ Object { "throughReferences": Array [], "type": "function", "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, }, }, ], @@ -7343,7 +8614,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -7351,7 +8622,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -7391,7 +8662,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -7403,7 +8674,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "C": Object { @@ -7411,7 +8682,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -7451,7 +8722,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -7465,7 +8736,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -7473,7 +8744,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 15, + "$id": 26, "block": Object { "range": Array [ 0, @@ -7483,7 +8754,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 25, "block": Object { "range": Array [ 0, @@ -7493,7 +8764,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 15, "block": Object { "range": Array [ 0, @@ -7503,7 +8774,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 14, "block": Object { "range": Array [ 60, @@ -7518,11 +8789,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 15, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 15, }, "variables": Array [], }, @@ -7531,10 +8802,48 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 11, "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { "$ref": 9, }, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 15, + }, "identifier": Object { "name": "Base", "range": Array [ @@ -7545,41 +8854,92 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 6, + "$ref": 10, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 11, + }, + ], "type": "function", "upperScope": Object { - "$ref": 14, + "$ref": 25, }, "variableMap": Object { "Base": Object { - "$ref": 6, + "$ref": 10, + }, + "T": Object { + "$ref": 9, }, "arguments": Object { - "$ref": 5, + "$ref": 8, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 15, }, "variables": Array [ Object { - "$id": 5, + "$id": 8, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 15, }, }, Object { - "$id": 6, + "$id": 9, + "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": 12, + }, + ], + "scope": Object { + "$ref": 15, + }, + }, + Object { + "$id": 10, "defs": Array [ Object { "name": Object { @@ -7615,17 +8975,17 @@ Object { "name": "Base", "references": Array [ Object { - "$ref": 7, + "$ref": 13, }, ], "scope": Object { - "$ref": 9, + "$ref": 15, }, }, ], }, Object { - "$id": 11, + "$id": 17, "block": Object { "range": Array [ 86, @@ -7640,19 +9000,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 14, + "$ref": 25, }, "variableMap": Object { "X": Object { - "$ref": 10, + "$ref": 16, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { - "$id": 10, + "$id": 16, "defs": Array [ Object { "name": Object { @@ -7688,13 +9048,13 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 17, }, }, ], }, Object { - "$id": 13, + "$id": 19, "block": Object { "range": Array [ 130, @@ -7709,19 +9069,19 @@ Object { "throughReferences": Array [], "type": "class", "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 +9117,145 @@ 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", + "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", + "upperScope": Object { + "$ref": 25, + }, + "variableMap": Object { + "T": Object { + "$ref": 21, + }, + }, + "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 +9265,28 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 14, + "$ref": 25, + }, + "identifier": Object { + "name": "I", + "range": Array [ + 123, + 124, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 25, }, "identifier": Object { "name": "M", @@ -7786,9 +9303,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 7, "from": Object { - "$ref": 14, + "$ref": 25, }, "identifier": Object { "name": "C", @@ -7805,15 +9322,25 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 22, + }, + ], "type": "module", "upperScope": Object { - "$ref": 15, + "$ref": 26, }, "variableMap": Object { "C": Object { "$ref": 2, }, + "Constructor": Object { + "$ref": 4, + }, + "I": Object { + "$ref": 3, + }, "M": Object { "$ref": 0, }, @@ -7822,7 +9349,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { @@ -7862,11 +9389,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 14, + "$ref": 25, }, }, Object { @@ -7906,7 +9433,7 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 25, }, }, Object { @@ -7946,11 +9473,99 @@ Object { "name": "C", "references": Array [ Object { - "$ref": 4, + "$ref": 7, }, ], "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": 5, + }, + ], + "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": 11, + }, + ], + "scope": Object { + "$ref": 25, }, }, ], @@ -7959,12 +9574,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 22, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 26, }, "variables": Array [], } @@ -7972,7 +9591,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, @@ -7982,7 +9601,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, @@ -7992,7 +9611,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, @@ -8003,14 +9622,80 @@ 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": Object { + "$ref": 0, + }, + "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", "upperScope": Object { - "$ref": 4, + "$ref": 8, }, "variableMap": Object { "Base": Object { + "$ref": 3, + }, + "T": Object { "$ref": 2, }, "arguments": Object { @@ -8018,7 +9703,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 7, }, "variables": Array [ Object { @@ -8029,11 +9714,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 +9798,7 @@ Object { "name": "Base", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -8078,10 +9807,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object { "M": Object { @@ -8089,7 +9822,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -8127,9 +9860,13 @@ Object { }, ], "name": "M", - "references": Array [], + "references": Array [ + Object { + "$ref": 5, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -8138,12 +9875,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 9, }, "variables": Array [], } @@ -11570,7 +13311,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 +13321,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -11590,7 +13331,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -11600,7 +13341,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 25, @@ -11615,15 +13356,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -11634,13 +13378,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, @@ -11655,26 +13439,69 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { + "T": Object { + "$ref": 6, + }, "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, }, }, ], @@ -11686,7 +13513,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "A": Object { @@ -11694,7 +13521,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -11734,7 +13561,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -11746,7 +13573,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "A": Object { @@ -11754,7 +13581,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -11794,7 +13621,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -11808,7 +13635,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -11816,7 +13643,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -11826,7 +13653,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -11836,7 +13663,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -11851,19 +13678,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -11899,7 +13726,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -11911,19 +13738,62 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { "$id": 0, + "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": 4, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -11959,7 +13829,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -11973,7 +13843,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -11981,7 +13851,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 +13861,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12001,7 +13871,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12016,19 +13886,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -12064,7 +13934,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -12072,23 +13942,88 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, + "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": 5, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -12124,7 +14059,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -12133,12 +14068,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -12146,7 +14085,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 +14095,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12166,7 +14105,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -12181,19 +14120,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "A": Object { - "$ref": 1, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -12229,7 +14168,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -12241,19 +14180,62 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "A": Object { + "$ref": 1, + }, + "__P": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { "$id": 0, + "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": 4, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -12289,7 +14271,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -12303,7 +14285,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -12311,7 +14293,7 @@ Object { exports[`typescript fixtures/basics/const-assertions.src 1`] = ` Object { - "$id": 10, + "$id": 16, "block": Object { "range": Array [ 13, @@ -12321,7 +14303,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 15, "block": Object { "range": Array [ 13, @@ -12336,7 +14318,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 9, + "$ref": 15, }, "identifier": Object { "name": "x", @@ -12361,7 +14343,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 +14383,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 +14425,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 +14467,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 +14509,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 +14550,47 @@ 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", "upperScope": Object { - "$ref": 10, + "$ref": 16, }, "variableMap": Object { "x": Object { @@ -12501,7 +14604,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 15, }, "variables": Array [ Object { @@ -12583,11 +14686,11 @@ Object { "$ref": 3, }, Object { - "$ref": 6, + "$ref": 9, }, ], "scope": Object { - "$ref": 9, + "$ref": 15, }, }, Object { @@ -12666,14 +14769,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 +14855,14 @@ Object { "name": "z", "references": Array [ Object { - "$ref": 5, + "$ref": 7, }, Object { - "$ref": 8, + "$ref": 13, }, ], "scope": Object { - "$ref": 9, + "$ref": 15, }, }, ], @@ -12768,12 +14871,31 @@ 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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 16, }, "variables": Array [], } @@ -15263,7 +17385,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 +17395,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15283,7 +17405,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 15, @@ -15298,11 +17420,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -15313,13 +17435,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "T": Object { + "$ref": 0, + }, }, - "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": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -15330,7 +17497,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -15338,7 +17505,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 +17515,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15358,7 +17525,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 15, @@ -15373,11 +17540,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -15388,13 +17555,101 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 4, + }, + "variableMap": Object { + "T": Object { + "$ref": 0, + }, + "U": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, - "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, + 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": 3, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + ], + "name": "U", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -15405,7 +17660,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -15413,7 +17668,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -15423,7 +17678,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -15433,7 +17688,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -15448,19 +17703,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -15496,7 +17751,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -15508,19 +17763,62 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { "$id": 0, + "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": 4, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -15556,7 +17854,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -15570,7 +17868,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -15578,7 +17876,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -15588,7 +17886,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -15598,7 +17896,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 7, @@ -15613,19 +17911,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -15661,7 +17959,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -15673,19 +17971,105 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { + "$ref": 2, + }, + "T": Object { "$ref": 0, }, + "U": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, + "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": 5, + }, + }, + Object { + "$id": 1, + "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": 5, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { @@ -15721,7 +18105,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -15735,7 +18119,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -16386,7 +18770,7 @@ Object { exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16396,7 +18780,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16404,20 +18788,90 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "TestAlias": Object { + "$ref": 0, + }, }, - "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, @@ -16428,7 +18882,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -16436,7 +18890,7 @@ Object { exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16446,7 +18900,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16454,20 +18908,90 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "TestClassProps": Object { + "$ref": 0, + }, }, - "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, @@ -16478,7 +19002,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -16486,7 +19010,7 @@ Object { exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -16496,7 +19020,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16504,31 +19028,131 @@ 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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "TestCallback": Object { + "$ref": 0, + }, }, - "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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -16536,7 +19160,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 +19170,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16556,7 +19180,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 10, @@ -16569,9 +19193,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "a", @@ -16583,7 +19207,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 4, }, "writeExpr": undefined, }, @@ -16591,18 +19215,21 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "a": Object { + "T": Object { "$ref": 3, }, + "a": Object { + "$ref": 4, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -16613,11 +19240,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 +19320,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -16669,7 +19336,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "obj", @@ -16695,7 +19362,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "obj": Object { @@ -16703,7 +19370,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -16753,7 +19420,7 @@ Object { }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -16767,7 +19434,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } @@ -17935,7 +20602,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -17945,7 +20612,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -17955,7 +20622,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -17968,9 +20635,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,7 +20687,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, @@ -17990,18 +20695,21 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { + "X": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -18012,11 +20720,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 +20807,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -18068,7 +20823,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -18076,7 +20831,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { @@ -18116,7 +20871,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -18130,7 +20885,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [], } @@ -18138,7 +20893,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 +20903,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -18158,7 +20913,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -18173,15 +20928,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -18192,7 +20950,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, }, }, ], @@ -18204,7 +21002,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "compare": Object { @@ -18212,7 +21010,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -18252,7 +21050,7 @@ Object { "name": "compare", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -18266,7 +21064,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -18274,7 +21072,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 +21082,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -18294,7 +21092,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -18307,9 +21105,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,7 +21157,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, @@ -18329,18 +21165,21 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { + "X": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -18351,11 +21190,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 +21277,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -18407,7 +21293,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -18415,7 +21301,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { @@ -18455,7 +21341,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -18469,7 +21355,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [], } @@ -18680,7 +21566,7 @@ Object { exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -18690,7 +21576,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -18700,7 +21586,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -18715,7 +21601,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "age", @@ -18740,7 +21626,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 +21660,14 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "age": Object { @@ -18777,7 +21684,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -18788,7 +21695,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -18828,11 +21735,11 @@ Object { "name": "name", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -18876,7 +21783,7 @@ Object { }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -18916,7 +21823,7 @@ Object { "name": "args", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -18925,10 +21832,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "message": Object { @@ -18936,7 +21847,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -18976,7 +21887,7 @@ Object { "name": "message", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -18985,12 +21896,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [], } @@ -19445,7 +22360,7 @@ Object { exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19455,7 +22370,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19463,31 +22378,224 @@ 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", + "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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 7, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + "B": Object { + "$ref": 1, + }, }, - "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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -19495,7 +22603,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 +22613,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19513,31 +22621,157 @@ 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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 5, + }, + "variableMap": Object { + "X": Object { + "$ref": 0, + }, }, - "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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -19545,7 +22779,7 @@ Object { exports[`typescript fixtures/basics/interface-extends.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19555,7 +22789,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19563,216 +22797,228 @@ 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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "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-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", "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", + "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, }, @@ -19782,22 +23028,64 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, }, @@ -19809,96 +23097,159 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 50, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 50, + 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", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", + "$ref": 4, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + "T": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "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": 3, + }, + }, + Object { + "$id": 1, + "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, @@ -19909,874 +23260,483 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 1, + "$id": 22, "block": Object { "range": Array [ 0, - 37, + 269, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 21, "block": Object { "range": Array [ 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 88, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 88, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/keyword-variables.src 1`] = ` -Object { - "$id": 20, - "block": Object { - "range": Array [ - 0, - 190, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 19, - "block": Object { - "range": Array [ - 0, - 190, + 269, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 18, + "$id": 20, "block": Object { "range": Array [ 0, - 110, + 267, ], - "type": "BlockStatement", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 12, + "$id": 3, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { - "name": "get", + "name": "bax", "range": Array [ - 10, - 13, + 56, + 59, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 6, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 20, }, - "writeExpr": Object { + "identifier": Object { + "name": "baz", "range": Array [ - 16, - 17, + 75, + 78, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 5, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { - "name": "set", + "name": "eee", "range": Array [ - 27, - 30, + 95, + 106, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 7, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 20, }, - "writeExpr": Object { + "identifier": Object { + "name": "a", "range": Array [ - 33, - 34, + 143, + 144, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 7, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { - "name": "module", + "name": "b", "range": Array [ - 44, - 50, + 146, + 147, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 8, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 20, }, - "writeExpr": Object { + "identifier": Object { + "name": "c", "range": Array [ - 53, - 54, + 149, + 150, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 9, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { - "name": "type", + "name": "loo", "range": Array [ - 64, - 68, + 164, + 167, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 9, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 20, }, - "writeExpr": Object { + "identifier": Object { + "name": "a", "range": Array [ - 71, - 72, + 170, + 171, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 16, + "$id": 11, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { - "name": "async", + "name": "b", "range": Array [ - 82, - 87, + 173, + 174, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 10, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 20, }, - "writeExpr": Object { + "identifier": Object { + "name": "c", "range": Array [ - 90, - 91, + 176, + 177, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 13, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { - "name": "is", + "name": "a", "range": Array [ - 101, - 103, + 197, + 198, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 11, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 20, }, - "writeExpr": Object { + "identifier": Object { + "name": "b", "range": Array [ - 106, - 107, + 200, + 201, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 19, - }, - "variableMap": Object { - "async": Object { - "$ref": 10, + Object { + "$id": 15, + "from": Object { + "$ref": 20, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 203, + 204, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - "get": Object { - "$ref": 6, + Object { + "$id": 16, + "from": Object { + "$ref": 20, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - "is": Object { - "$ref": 11, + Object { + "$id": 17, + "from": Object { + "$ref": 20, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 225, + 227, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - "module": Object { - "$ref": 8, + Object { + "$id": 18, + "from": Object { + "$ref": 20, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 250, + 251, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - "set": Object { + Object { + "$id": 19, + "from": Object { + "$ref": 20, + }, + "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, }, - "type": Object { + Object { + "$ref": 8, + }, + Object { "$ref": 9, }, - }, - "variableScope": Object { - "$ref": 19, - }, - "variables": Array [ Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "get", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 10, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 4, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [ - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 18, - }, + "$ref": 10, }, Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "set", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 21, - 35, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - ], - "name": "set", - "references": Array [ - Object { - "$ref": 13, - }, - ], - "scope": Object { - "$ref": 18, - }, + "$ref": 11, }, Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "module", - "range": Array [ - 44, - 50, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 54, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 38, - 55, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "module", - "range": Array [ - 44, - 50, - ], - "type": "Identifier", - }, - ], - "name": "module", - "references": Array [ - Object { - "$ref": 14, - }, - ], - "scope": Object { - "$ref": 18, - }, + "$ref": 12, }, Object { - "$id": 9, - "defs": Array [ - Object { - "name": Object { - "name": "type", - "range": Array [ - 64, - 68, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 64, - 72, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 58, - 73, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "type", - "range": Array [ - 64, - 68, - ], - "type": "Identifier", - }, - ], - "name": "type", - "references": Array [ - Object { - "$ref": 15, - }, - ], - "scope": Object { - "$ref": 18, - }, + "$ref": 13, }, Object { - "$id": 10, + "$ref": 14, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, + Object { + "$ref": 19, + }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 21, + }, + "variableMap": Object { + "F": Object { + "$ref": 2, + }, + "J": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 21, + }, + "variables": Array [ + Object { + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "async", + "name": "J", "range": Array [ - 82, - 87, + 194, + 195, ], "type": "Identifier", }, "node": Object { "range": Array [ - 82, - 91, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 76, - 92, + 193, + 196, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "async", + "name": "J", "range": Array [ - 82, - 87, + 194, + 195, ], "type": "Identifier", }, ], - "name": "async", - "references": Array [ - Object { - "$ref": 16, - }, - ], + "name": "J", + "references": Array [], "scope": Object { - "$ref": 18, + "$ref": 20, }, }, Object { - "$id": 11, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "is", + "name": "F", "range": Array [ - 101, - 103, + 247, + 248, ], "type": "Identifier", }, "node": Object { "range": Array [ - 101, - 107, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 95, - 108, + 246, + 249, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "is", + "name": "F", "range": Array [ - 101, - 103, + 247, + 248, ], "type": "Identifier", }, ], - "name": "is", - "references": Array [ - Object { - "$ref": 17, - }, - ], + "name": "F", + "references": Array [], "scope": Object { - "$ref": 18, + "$ref": 20, }, }, ], @@ -20785,33 +23745,70 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 20, - }, - "variableMap": Object { - "async": Object { - "$ref": 4, + "throughReferences": Array [ + Object { + "$ref": 3, }, - "get": Object { - "$ref": 0, + Object { + "$ref": 4, }, - "is": Object { + Object { "$ref": 5, }, - "module": Object { - "$ref": 2, + Object { + "$ref": 6, }, - "set": Object { - "$ref": 1, + Object { + "$ref": 7, }, - "type": Object { - "$ref": 3, + 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, + }, + Object { + "$ref": 19, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 22, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 21, }, "variables": Array [ Object { @@ -20819,275 +23816,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "get", - "range": Array [ - 123, - 126, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 123, - 126, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 112, - 189, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "get", - "range": Array [ - 123, - 126, - ], - "type": "Identifier", - }, - ], - "name": "get", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "set", + "name": "Foo", "range": Array [ - 130, - 133, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ - 130, - 133, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 112, - 189, + 0, + 267, ], - "type": "ImportDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "ImportBinding", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "set", + "name": "Foo", "range": Array [ - 130, - 133, + 10, + 13, ], "type": "Identifier", }, ], - "name": "set", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "module", - "range": Array [ - 137, - 143, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 137, - 143, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 112, - 189, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "module", - "range": Array [ - 137, - 143, - ], - "type": "Identifier", - }, - ], - "name": "module", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "type", - "range": Array [ - 147, - 151, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 147, - 151, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 112, - 189, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "type", - "range": Array [ - 147, - 151, - ], - "type": "Identifier", - }, - ], - "name": "type", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "async", - "range": Array [ - 155, - 160, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 155, - 160, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 112, - 189, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "async", - "range": Array [ - 155, - 160, - ], - "type": "Identifier", - }, - ], - "name": "async", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "is", - "range": Array [ - 164, - 166, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 164, - 166, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 112, - 189, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "is", - "range": Array [ - 164, - 166, - ], - "type": "Identifier", - }, - ], - "name": "is", - "references": Array [], - "scope": Object { - "$ref": 19, + "$ref": 21, }, }, ], @@ -21096,53 +23857,179 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": 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, + }, + Object { + "$ref": 19, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 20, + "$ref": 22, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 44, + 50, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 44, + 50, ], "type": "Program", }, - "childScopes": Array [], + "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", + "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", "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "nestedArray": Object { + "Test": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -21150,45 +24037,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "nestedArray", + "name": "Test", "range": Array [ - 4, - 44, + 10, + 14, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 44, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 44, + 49, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "nestedArray", + "name": "Test", "range": Array [ - 4, - 44, + 10, + 14, ], "type": "Identifier", }, ], - "name": "nestedArray", + "name": "Test", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -21197,59 +24078,95 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 46, + 34, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 46, + 34, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "Observable", + "$id": 2, + "block": Object { "range": Array [ - 19, - 29, + 0, + 33, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "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", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [ Object { "$ref": 1, @@ -21257,15 +24174,15 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { - "x": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -21273,45 +24190,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "foo", "range": Array [ - 6, - 17, + 10, + 13, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 18, + 33, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "foo", "range": Array [ - 6, - 17, + 10, + 13, ], "type": "Identifier", }, ], - "name": "x", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -21329,99 +24240,125 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/new-target-in-arrow-function-body.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 28, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 28, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ - 10, - 26, + 0, + 36, ], - "type": "ArrowFunctionExpression", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", + "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", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 26, - ], - "type": "ArrowFunctionExpression", - }, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], - "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { - "b": Object { + "Foo": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -21429,377 +24366,79 @@ Object { "defs": Array [ Object { "name": Object { - "name": "b", + "name": "T", "range": Array [ - 6, - 7, + 14, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 26, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 27, + 13, + 16, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "b", + "name": "T", "range": Array [ - 6, - 7, + 14, + 15, ], "type": "Identifier", }, ], - "name": "b", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "T", + "references": Array [], "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` -Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "validateEntity", - "range": Array [ - 41, - 55, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "e", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 72, - 79, - ], - "type": "MemberExpression", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "e", - "range": Array [ - 72, - 73, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "e": Object { - "$ref": 2, - }, - "s": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 8, + "$ref": 5, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "e", - "range": Array [ - 23, - 33, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "e", - "range": Array [ - 23, - 33, - ], - "type": "Identifier", - }, - ], - "name": "e", - "references": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "s", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 68, - 79, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 64, - 80, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - ], - "name": "s", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "processEntity": Object { - "$ref": 0, }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "processEntity", + "name": "Foo", "range": Array [ - 9, - 22, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 36, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processEntity", + "name": "Foo", "range": Array [ - 9, - 22, + 10, + 13, ], "type": "Identifier", }, ], - "name": "processEntity", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 5, }, }, ], @@ -21810,58 +24449,86 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 30, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 30, + 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", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { - "x": Object { + "T": Object { "$ref": 0, }, - "y": Object { + "Test": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -21869,45 +24536,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "T", "range": Array [ - 4, - 11, + 15, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 12, + 14, + 17, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "T", "range": Array [ - 4, - 11, + 15, + 16, ], "type": "Identifier", }, ], - "name": "x", + "name": "T", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, Object { @@ -21915,45 +24576,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "y", + "name": "Test", "range": Array [ - 17, - 29, + 10, + 14, ], "type": "Identifier", }, "node": Object { "range": Array [ - 17, - 29, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 13, - 30, + 0, + 21, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "y", + "name": "Test", "range": Array [ - 17, - 29, + 10, + 14, ], "type": "Identifier", }, ], - "name": "y", + "name": "Test", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -21967,70 +24622,248 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/nullish-coalescing.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { - "$id": 8, + "$id": 4, "block": Object { "range": Array [ 0, - 71, + 88, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 71, + 88, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ 0, - 70, + 87, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 2, }, "identifier": Object { - "name": "len", + "name": "bar", "range": Array [ - 52, - 55, + 80, + 83, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 3, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "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", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Test": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", }, - "writeExpr": Object { + "node": Object { "range": Array [ - 59, - 66, + 0, + 87, ], - "type": "LogicalExpression", + "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 [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 62, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 62, + ], + "type": "Program", + }, + "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, @@ -22038,139 +24871,82 @@ Object { "$ref": 6, }, "identifier": Object { - "name": "s", + "name": "T", "range": Array [ - 59, - 60, + 57, + 58, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 1, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "function", + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "arguments": Object { + "T": Object { "$ref": 1, }, - "len": Object { - "$ref": 3, - }, - "s": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 2, "defs": Array [ Object { "name": Object { - "name": "s", + "name": "T", "range": Array [ - 32, - 42, + 45, + 46, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 70, + 44, + 47, ], - "type": "FunctionDeclaration", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "Parameter", + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s", + "name": "T", "range": Array [ - 32, - 42, + 45, + 46, ], "type": "Identifier", }, ], - "name": "s", + "name": "T", "references": Array [ Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "len", - "range": Array [ - 52, - 55, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 52, - 67, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 48, - 68, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "len", - "range": Array [ - 52, - 55, - ], - "type": "Identifier", + "$ref": 4, }, - ], - "name": "len", - "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { @@ -22183,13 +24959,20 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "processNullishCoalesce": Object { + "test": Object { "$ref": 0, }, }, @@ -22202,36 +24985,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processNullishCoalesce", + "name": "test", "range": Array [ - 9, - 31, + 10, + 14, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 70, + 61, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processNullishCoalesce", + "name": "test", "range": Array [ - 9, - 31, + 10, + 14, ], "type": "Identifier", }, ], - "name": "processNullishCoalesce", + "name": "test", "references": Array [], "scope": Object { "$ref": 7, @@ -22243,7 +25026,14 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -22254,7 +25044,7 @@ Object { } `; -exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` Object { "$id": 6, "block": Object { @@ -22276,125 +25066,112 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ - 26, - 31, + 0, + 81, ], - "type": "FunctionExpression", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ + "references": Array [ Object { "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 54, + 57, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - }, - Object { - "$id": 4, - "block": Object { - "range": Array [ - 58, - 81, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "X": Object { - "$ref": 3, + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 59, + 71, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ Object { "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 64, - 65, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 81, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 64, - 65, - ], - "type": "Identifier", - }, - ], - "name": "X", - "references": Array [], - "scope": Object { + "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", + "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", "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "X": Object { + "test": Object { "$ref": 0, }, }, @@ -22407,36 +25184,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "test", "range": Array [ - 64, - 65, + 10, + 14, ], "type": "Identifier", }, "node": Object { "range": Array [ - 58, + 0, 81, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "ClassName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "test", "range": Array [ - 64, - 65, + 10, + 14, ], "type": "Identifier", }, ], - "name": "X", + "name": "test", "references": Array [], "scope": Object { "$ref": 5, @@ -22448,7 +25225,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -22459,272 +25246,213 @@ Object { } `; -exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` +exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { - "$id": 12, + "$id": 3, "block": Object { "range": Array [ 0, - 176, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 2, "block": Object { "range": Array [ 0, - 176, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ - 29, - 61, + 0, + 27, ], - "type": "FunctionExpression", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "interface", "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "test": Object { + "$ref": 0, }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ Object { - "$id": 5, - "block": Object { - "range": Array [ - 68, - 100, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, + "name": Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", }, + "parent": null, + "type": "InterfaceName", }, ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 109, - 138, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", }, ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 2, + }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 10, + "$id": 2, "block": Object { "range": Array [ - 147, - 172, + 0, + 19, ], - "type": "FunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 8, - }, - "x": Object { - "$ref": 9, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ + "references": Array [ Object { - "$id": 8, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 10, + "$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 { - "$id": 9, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 148, - 157, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 147, - 172, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 148, - 157, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 10, - }, + "$ref": 1, }, ], + "type": "type-alias", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 174, - ], - "type": "ObjectExpression", - }, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 4, }, "variableMap": Object { - "foo": Object { + "x": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 3, }, "variables": Array [ Object { @@ -22732,49 +25460,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "x", "range": Array [ + 5, 6, - 9, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 174, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 175, + 19, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "x", "range": Array [ + 5, 6, - 9, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "x", + "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 3, }, }, ], @@ -22783,229 +25501,533 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/optional-chain.src 1`] = ` +exports[`typescript fixtures/basics/keyword-variables.src 1`] = ` Object { - "$id": 10, + "$id": 20, "block": Object { "range": Array [ 0, - 135, + 190, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 19, "block": Object { "range": Array [ 0, - 135, + 190, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 18, "block": Object { "range": Array [ 0, - 134, + 110, ], - "type": "FunctionDeclaration", + "type": "BlockStatement", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 12, "from": Object { - "$ref": 8, + "$ref": 18, }, "identifier": Object { - "name": "one", + "name": "get", "range": Array [ - 40, - 43, + 10, + 13, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 6, + }, + "writeExpr": Object { + "range": Array [ + 16, + 17, + ], + "type": "Literal", }, - "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 13, "from": Object { - "$ref": 8, + "$ref": 18, }, "identifier": Object { - "name": "one", + "name": "set", "range": Array [ - 52, - 55, + 27, + 30, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 7, + }, + "writeExpr": Object { + "range": Array [ + 33, + 34, + ], + "type": "Literal", }, - "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 14, "from": Object { - "$ref": 8, + "$ref": 18, }, "identifier": Object { - "name": "one", + "name": "module", "range": Array [ - 70, - 73, + 44, + 50, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 8, + }, + "writeExpr": Object { + "range": Array [ + 53, + 54, + ], + "type": "Literal", }, - "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 15, "from": Object { - "$ref": 8, + "$ref": 18, }, "identifier": Object { - "name": "one", + "name": "type", "range": Array [ - 88, - 91, + 64, + 68, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 9, + }, + "writeExpr": Object { + "range": Array [ + 71, + 72, + ], + "type": "Literal", }, - "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 16, "from": Object { - "$ref": 8, + "$ref": 18, }, "identifier": Object { - "name": "one", + "name": "async", "range": Array [ - 111, - 114, + 82, + 87, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 10, + }, + "writeExpr": Object { + "range": Array [ + 90, + 91, + ], + "type": "Literal", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, }, - "one": Object { - "$ref": 2, + Object { + "$id": 17, + "from": Object { + "$ref": 18, + }, + "identifier": Object { + "name": "is", + "range": Array [ + 101, + 103, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 11, + }, + "writeExpr": Object { + "range": Array [ + 106, + 107, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 19, + }, + "variableMap": Object { + "async": Object { + "$ref": 10, + }, + "get": Object { + "$ref": 6, + }, + "is": Object { + "$ref": 11, + }, + "module": Object { + "$ref": 8, + }, + "set": Object { + "$ref": 7, + }, + "type": Object { + "$ref": 9, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 19, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "get", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 17, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 4, + 18, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], + "identifiers": Array [ + Object { + "name": "get", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "get", + "references": Array [ + Object { + "$ref": 12, + }, + ], "scope": Object { - "$ref": 8, + "$ref": 18, }, }, Object { - "$id": 2, + "$id": 7, "defs": Array [ Object { "name": Object { - "name": "one", + "name": "set", "range": Array [ - 25, + 27, + 30, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, 34, ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 21, + 35, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "set", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + ], + "name": "set", + "references": Array [ + Object { + "$ref": 13, + }, + ], + "scope": Object { + "$ref": 18, + }, + }, + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "module", + "range": Array [ + 44, + 50, + ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 134, + 44, + 54, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "Parameter", + "parent": Object { + "range": Array [ + 38, + 55, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "one", + "name": "module", "range": Array [ - 25, - 34, + 44, + 50, ], "type": "Identifier", }, ], - "name": "one", + "name": "module", "references": Array [ Object { - "$ref": 3, + "$ref": 14, }, + ], + "scope": Object { + "$ref": 18, + }, + }, + Object { + "$id": 9, + "defs": Array [ Object { - "$ref": 4, + "name": Object { + "name": "type", + "range": Array [ + 64, + 68, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 64, + 72, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 58, + 73, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 5, + "name": "type", + "range": Array [ + 64, + 68, + ], + "type": "Identifier", }, + ], + "name": "type", + "references": Array [ Object { - "$ref": 6, + "$ref": 15, }, + ], + "scope": Object { + "$ref": 18, + }, + }, + Object { + "$id": 10, + "defs": Array [ Object { - "$ref": 7, + "name": Object { + "name": "async", + "range": Array [ + 82, + 87, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 82, + 91, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 76, + 92, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "async", + "range": Array [ + 82, + 87, + ], + "type": "Identifier", + }, + ], + "name": "async", + "references": Array [ + Object { + "$ref": 16, }, ], "scope": Object { - "$ref": 8, + "$ref": 18, + }, + }, + Object { + "$id": 11, + "defs": Array [ + Object { + "name": Object { + "name": "is", + "range": Array [ + 101, + 103, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 101, + 107, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 95, + 108, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "is", + "range": Array [ + 101, + 103, + ], + "type": "Identifier", + }, + ], + "name": "is", + "references": Array [ + Object { + "$ref": 17, + }, + ], + "scope": Object { + "$ref": 18, }, }, ], @@ -23017,15 +26039,30 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 20, }, "variableMap": Object { - "processOptional": Object { + "async": Object { + "$ref": 4, + }, + "get": Object { "$ref": 0, }, + "is": Object { + "$ref": 5, + }, + "module": Object { + "$ref": 2, + }, + "set": Object { + "$ref": 1, + }, + "type": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 9, + "$ref": 19, }, "variables": Array [ Object { @@ -23033,378 +26070,392 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptional", + "name": "get", "range": Array [ - 9, - 24, + 123, + 126, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 134, + 123, + 126, ], - "type": "FunctionDeclaration", + "type": "ImportSpecifier", }, - "parent": null, - "type": "FunctionName", + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", + }, + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptional", + "name": "get", "range": Array [ - 9, - 24, + 123, + 126, ], "type": "Identifier", }, ], - "name": "processOptional", + "name": "get", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 19, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/optional-chain-call.src 1`] = ` -Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 194, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 13, - "block": Object { - "range": Array [ - 0, - 194, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 12, - "block": Object { - "range": Array [ - 0, - 193, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "$id": 1, + "defs": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "name": Object { + "name": "set", "range": Array [ - 44, - 47, + 130, + 133, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "node": Object { "range": Array [ - 57, - 60, + 130, + 133, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 12, + "type": "ImportSpecifier", }, - "identifier": Object { - "name": "one", + "parent": Object { "range": Array [ - 74, - 77, + 112, + 189, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "type": "ImportDeclaration", }, - "writeExpr": undefined, + "type": "ImportBinding", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 91, - 94, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, + "name": "set", + "range": Array [ + 130, + 133, + ], + "type": "Identifier", }, + ], + "name": "set", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 2, + "defs": Array [ Object { - "$id": 7, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "name": Object { + "name": "module", "range": Array [ - 114, - 117, + 137, + 143, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "node": Object { "range": Array [ - 139, - 142, + 137, + 143, ], - "type": "Identifier", + "type": "ImportSpecifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", }, - "writeExpr": undefined, + "type": "ImportBinding", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 9, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "name": "module", + "range": Array [ + 137, + 143, + ], + "type": "Identifier", + }, + ], + "name": "module", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "type", "range": Array [ - 150, - 153, + 147, + 151, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "node": Object { "range": Array [ - 163, - 166, + 147, + 151, ], - "type": "Identifier", + "type": "ImportSpecifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", }, - "writeExpr": undefined, + "type": "ImportBinding", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 11, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "name": "type", + "range": Array [ + 147, + 151, + ], + "type": "Identifier", + }, + ], + "name": "type", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "async", "range": Array [ - 179, - 182, + 155, + 160, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "node": Object { + "range": Array [ + 155, + 160, + ], + "type": "ImportSpecifier", }, - "writeExpr": undefined, + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", + }, + "type": "ImportBinding", }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "one": Object { - "$ref": 2, + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "async", + "range": Array [ + 155, + 160, + ], + "type": "Identifier", }, + ], + "name": "async", + "references": Array [], + "scope": Object { + "$ref": 19, }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ + }, + Object { + "$id": 5, + "defs": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 12, + "name": Object { + "name": "is", + "range": Array [ + 164, + 166, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 164, + 166, + ], + "type": "ImportSpecifier", + }, + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", }, + "type": "ImportBinding", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "one", - "range": Array [ - 29, - 38, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 193, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 29, - 38, - ], - "type": "Identifier", - }, - ], - "name": "one", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, + "name": "is", + "range": Array [ + 164, + 166, ], - "scope": Object { - "$ref": 12, - }, + "type": "Identifier", }, ], + "name": "is", + "references": Array [], + "scope": Object { + "$ref": 19, + }, }, ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 20, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 44, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 44, + ], + "type": "Program", + }, + "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", "upperScope": Object { - "$ref": 14, + "$ref": 5, }, "variableMap": Object { - "processOptionalCall": Object { + "nestedArray": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 13, + "$ref": 4, }, "variables": Array [ Object { @@ -23412,39 +26463,45 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalCall", + "name": "nestedArray", "range": Array [ - 9, - 28, + 4, + 44, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 193, + 44, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalCall", + "name": "nestedArray", "range": Array [ - 9, - 28, + 4, + 44, ], "type": "Identifier", }, ], - "name": "processOptionalCall", + "name": "nestedArray", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 4, }, }, ], @@ -23453,337 +26510,264 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/optional-chain-call-with-parens.src 1`] = ` +exports[`typescript fixtures/basics/never-type-param.src 1`] = ` Object { - "$id": 14, + "$id": 4, "block": Object { "range": Array [ 0, - 218, + 46, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 13, + "$id": 3, "block": Object { "range": Array [ 0, - 218, + 46, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 12, - "block": Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "X", "range": Array [ - 0, - 217, + 9, + 10, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 51, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 66, - 69, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 85, - 88, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 104, - 107, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 129, - 132, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Observable", + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 8, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "name": Object { + "name": "x", "range": Array [ - 156, - 159, + 6, + 17, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", + "node": Object { "range": Array [ - 169, - 172, + 6, + 17, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 12, + "type": "VariableDeclarator", }, - "identifier": Object { - "name": "one", + "parent": Object { "range": Array [ - 184, - 187, + 0, + 18, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "type": "VariableDeclaration", }, - "writeExpr": undefined, + "type": "Variable", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 11, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 202, - 205, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, + "name": "x", + "range": Array [ + 6, + 17, + ], + "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", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/new-target-in-arrow-function-body.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 10, + 26, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "one": Object { - "$ref": 2, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "one", - "range": Array [ - 35, - 44, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 217, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "one", - "range": Array [ - 35, - 44, - ], - "type": "Identifier", - }, - ], - "name": "one", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 12, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 26, + ], + "type": "ArrowFunctionExpression", + }, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 14, + "$ref": 4, }, "variableMap": Object { - "processOptionalCallParens": Object { + "b": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 13, + "$ref": 3, }, "variables": Array [ Object { @@ -23791,39 +26775,49 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalCallParens", + "name": "b", "range": Array [ - 9, - 34, + 6, + 7, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 26, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 217, + 27, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalCallParens", + "name": "b", "range": Array [ - 9, - 34, + 6, + 7, ], "type": "Identifier", }, ], - "name": "processOptionalCallParens", - "references": Array [], + "name": "b", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 13, + "$ref": 3, }, }, ], @@ -23837,19 +26831,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/optional-chain-element-access.src 1`] = ` +exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` Object { "$id": 11, "block": Object { "range": Array [ 0, - 142, + 82, ], "type": "Program", }, @@ -23859,7 +26853,7 @@ Object { "block": Object { "range": Array [ 0, - 142, + 82, ], "type": "Program", }, @@ -23869,7 +26863,7 @@ Object { "block": Object { "range": Array [ 0, - 141, + 82, ], "type": "FunctionDeclaration", }, @@ -23878,53 +26872,49 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { "$ref": 9, }, "identifier": Object { - "name": "one", + "name": "Entity", "range": Array [ - 47, - 50, + 27, + 33, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { "$ref": 9, }, "identifier": Object { - "name": "one", + "name": "validateEntity", "range": Array [ - 59, - 62, + 41, + 55, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { "$ref": 9, }, "identifier": Object { - "name": "one", + "name": "e", "range": Array [ - 74, - 77, + 56, + 57, ], "type": "Identifier", }, @@ -23935,35 +26925,41 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 7, "from": Object { "$ref": 9, }, "identifier": Object { - "name": "one", + "name": "s", "range": Array [ - 89, - 92, + 68, + 69, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 72, + 79, + ], + "type": "MemberExpression", }, - "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 8, "from": Object { "$ref": 9, }, "identifier": Object { - "name": "one", + "name": "e", "range": Array [ - 104, - 107, - ], + 72, + 73, + ], "type": "Identifier", }, "kind": "r", @@ -23972,27 +26968,15 @@ Object { }, "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 8, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 122, - 125, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, + "$ref": 4, + }, + Object { + "$ref": 5, }, ], - "throughReferences": Array [], "type": "function", "upperScope": Object { "$ref": 10, @@ -24001,9 +26985,12 @@ Object { "arguments": Object { "$ref": 1, }, - "one": Object { + "e": Object { "$ref": 2, }, + "s": Object { + "$ref": 3, + }, }, "variableScope": Object { "$ref": 9, @@ -24025,17 +27012,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "one", + "name": "e", "range": Array [ - 32, - 41, + 23, + 33, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 141, + 82, ], "type": "FunctionDeclaration", }, @@ -24046,34 +27033,72 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "one", + "name": "e", "range": Array [ - 32, - 41, + 23, + 33, ], "type": "Identifier", }, ], - "name": "one", + "name": "e", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, Object { - "$ref": 4, + "$ref": 8, }, + ], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 3, + "defs": Array [ Object { - "$ref": 5, + "name": Object { + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 68, + 79, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 64, + 80, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 6, + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", }, + ], + "name": "s", + "references": Array [ Object { "$ref": 7, }, - Object { - "$ref": 8, - }, ], "scope": Object { "$ref": 9, @@ -24085,13 +27110,20 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "module", "upperScope": Object { "$ref": 11, }, "variableMap": Object { - "processOptionalElement": Object { + "processEntity": Object { "$ref": 0, }, }, @@ -24104,17 +27136,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalElement", + "name": "processEntity", "range": Array [ 9, - 31, + 22, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 141, + 82, ], "type": "FunctionDeclaration", }, @@ -24125,15 +27157,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalElement", + "name": "processEntity", "range": Array [ 9, - 31, + 22, ], "type": "Identifier", }, ], - "name": "processOptionalElement", + "name": "processEntity", "references": Array [], "scope": Object { "$ref": 10, @@ -24145,7 +27177,14 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -24156,145 +27195,225 @@ Object { } `; -exports[`typescript fixtures/basics/optional-chain-element-access-with-parens.src 1`] = ` +exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` Object { - "$id": 11, + "$id": 3, "block": Object { "range": Array [ 0, - 168, + 30, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 2, "block": Object { "range": Array [ 0, - 168, + 30, ], "type": "Program", }, - "childScopes": Array [ + "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": 9, - "block": Object { - "range": Array [ - 0, - 167, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", + "name": Object { + "name": "x", "range": Array [ - 54, - 57, + 4, + 11, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", + "node": Object { "range": Array [ - 68, - 71, + 4, + 11, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "parent": Object { + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", }, - "writeExpr": undefined, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", + "name": Object { + "name": "y", "range": Array [ - 85, - 88, + 17, + 29, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", + "node": Object { "range": Array [ - 102, - 105, + 17, + 29, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "parent": Object { + "range": Array [ + 13, + 30, + ], + "type": "VariableDeclaration", }, - "writeExpr": undefined, + "type": "Variable", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 7, + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + }, + ], + "name": "y", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/nullish-coalescing.src 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 71, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 71, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, "from": Object { - "$ref": 9, + "$ref": 6, }, "identifier": Object { - "name": "one", + "name": "len", "range": Array [ - 122, - 125, + 52, + 55, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 59, + 66, + ], + "type": "LogicalExpression", }, - "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 5, "from": Object { - "$ref": 9, + "$ref": 6, }, "identifier": Object { - "name": "one", + "name": "s", "range": Array [ - 144, - 147, + 59, + 60, ], "type": "Identifier", }, @@ -24308,18 +27427,21 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 10, + "$ref": 7, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, - "one": Object { + "len": Object { + "$ref": 3, + }, + "s": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 6, }, "variables": Array [ Object { @@ -24330,7 +27452,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 6, }, }, Object { @@ -24338,17 +27460,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "one", + "name": "s", "range": Array [ - 38, - 47, + 32, + 42, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 167, + 70, ], "type": "FunctionDeclaration", }, @@ -24359,37 +27481,72 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "one", + "name": "s", "range": Array [ - 38, - 47, + 32, + 42, ], "type": "Identifier", }, ], - "name": "one", + "name": "s", "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, Object { "$ref": 5, }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 3, + "defs": Array [ Object { - "$ref": 6, + "name": Object { + "name": "len", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 52, + 67, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 48, + 68, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 7, + "name": "len", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", }, + ], + "name": "len", + "references": Array [ Object { - "$ref": 8, + "$ref": 4, }, ], "scope": Object { - "$ref": 9, + "$ref": 6, }, }, ], @@ -24401,15 +27558,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 11, + "$ref": 8, }, "variableMap": Object { - "processOptionalElementParens": Object { + "processNullishCoalesce": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 7, }, "variables": Array [ Object { @@ -24417,17 +27574,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalElementParens", + "name": "processNullishCoalesce", "range": Array [ 9, - 37, + 31, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 167, + 70, ], "type": "FunctionDeclaration", }, @@ -24438,18 +27595,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalElementParens", + "name": "processNullishCoalesce", "range": Array [ 9, - 37, + 31, ], "type": "Identifier", }, ], - "name": "processOptionalElementParens", + "name": "processNullishCoalesce", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 7, }, }, ], @@ -24463,176 +27620,58 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/optional-chain-with-parens.src 1`] = ` +exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` Object { - "$id": 11, + "$id": 6, "block": Object { "range": Array [ 0, - 182, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 5, "block": Object { "range": Array [ 0, - 182, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 2, "block": Object { "range": Array [ - 0, - 181, + 26, + 31, ], - "type": "FunctionDeclaration", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 101, - 104, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 126, - 129, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "one", - "range": Array [ - 152, - 155, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 10, + "$ref": 5, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, - "one": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 9, + "$ref": 2, }, "variables": Array [ Object { @@ -24643,66 +27682,76 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 2, }, }, + ], + }, + Object { + "$id": 4, + "block": Object { + "range": Array [ + 58, + 81, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "X": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "one", + "name": "X", "range": Array [ - 31, - 40, + 64, + 65, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 181, + 58, + 81, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "one", + "name": "X", "range": Array [ - 31, - 40, + 64, + 65, ], "type": "Identifier", }, ], - "name": "one", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - ], + "name": "X", + "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 4, }, }, ], @@ -24714,15 +27763,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 11, + "$ref": 6, }, "variableMap": Object { - "processOptionalParens": Object { + "X": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 5, }, "variables": Array [ Object { @@ -24730,39 +27779,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processOptionalParens", + "name": "X", "range": Array [ - 9, - 30, + 64, + 65, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 181, + 58, + 81, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processOptionalParens", + "name": "X", "range": Array [ - 9, - 30, + 64, + 65, ], "type": "Identifier", }, ], - "name": "processOptionalParens", + "name": "X", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 5, }, }, ], @@ -24776,583 +27825,298 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 45, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 45, - 60, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/readonly-arrays.src 1`] = ` +exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, - 211, + 176, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, - 211, + 176, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ - 0, - 106, + 29, + 61, ], - "type": "FunctionDeclaration", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "arr", - "range": Array [ - 45, - 48, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "arr", - "range": Array [ - 75, - 78, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, + "T": Object { + "$ref": 3, }, - "arr": Object { + "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "arr", + "name": "T", "range": Array [ - 13, - 39, + 30, + 31, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 106, + 29, + 32, ], - "type": "FunctionDeclaration", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "Parameter", + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "arr", + "name": "T", "range": Array [ - 13, - 39, + 30, + 31, ], "type": "Identifier", }, ], - "name": "arr", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "name": "T", + "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], }, Object { - "$id": 10, + "$id": 7, "block": Object { "range": Array [ - 108, - 210, + 68, + 100, ], - "type": "FunctionDeclaration", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 8, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "arr", - "range": Array [ - 149, - 152, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 7, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "arr", - "range": Array [ - 179, - 182, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 7, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { - "arguments": Object { + "T": Object { "$ref": 6, }, - "arr": Object { - "$ref": 7, + "arguments": Object { + "$ref": 5, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 7, }, "variables": Array [ Object { - "$id": 6, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 7, }, }, Object { - "$id": 7, + "$id": 6, "defs": Array [ Object { "name": Object { - "name": "arr", + "name": "T", "range": Array [ - 121, - 143, + 69, + 70, ], "type": "Identifier", }, "node": Object { "range": Array [ - 108, - 210, + 68, + 71, ], - "type": "FunctionDeclaration", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "Parameter", + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "arr", + "name": "T", "range": Array [ - 121, - 143, + 69, + 70, ], "type": "Identifier", }, ], - "name": "arr", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - ], + "name": "T", + "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 7, }, }, ], }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 106, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", + "$id": 9, + "block": Object { + "range": Array [ + 109, + 138, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 8, }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ Object { - "name": Object { - "name": "foo", - "range": Array [ - 117, - 120, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 108, - 210, - ], - "type": "FunctionDeclaration", + "$id": 8, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - Object { - "name": "foo", - "range": Array [ - 117, - 120, - ], - "type": "Identifier", }, ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 11, - }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/readonly-tuples.src 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 119, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 119, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 6, + "$id": 12, "block": Object { "range": Array [ - 0, - 118, + 147, + 172, ], - "type": "FunctionDeclaration", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "console", - "range": Array [ - 50, - 57, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "pair", - "range": Array [ - 62, - 66, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "pair", - "range": Array [ - 84, - 88, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 13, }, "variableMap": Object { "arguments": Object { - "$ref": 1, + "$ref": 10, }, - "pair": Object { - "$ref": 2, + "x": Object { + "$ref": 11, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 12, }, "variables": Array [ Object { - "$id": 1, + "$id": 10, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 12, }, }, Object { - "$id": 2, + "$id": 11, "defs": Array [ Object { "name": Object { - "name": "pair", + "name": "x", "range": Array [ - 13, - 44, + 148, + 157, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 118, + 147, + 172, ], - "type": "FunctionDeclaration", + "type": "FunctionExpression", }, "parent": null, "type": "Parameter", @@ -25361,25 +28125,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "pair", + "name": "x", "range": Array [ - 13, - 44, + 148, + 157, ], "type": "Identifier", }, ], - "name": "pair", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], + "name": "x", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 12, }, }, ], @@ -25387,15 +28144,37 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "references": Array [ Object { - "$ref": 3, + "$id": 1, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 174, + ], + "type": "ObjectExpression", + }, }, ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 14, }, "variableMap": Object { "foo": Object { @@ -25403,7 +28182,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 13, }, "variables": Array [ Object { @@ -25413,20 +28192,26 @@ Object { "name": Object { "name": "foo", "range": Array [ + 6, 9, - 12, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 174, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 118, + 175, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, @@ -25434,16 +28219,20 @@ Object { Object { "name": "foo", "range": Array [ + 6, 9, - 12, ], "type": "Identifier", }, ], "name": "foo", - "references": Array [], + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 13, }, }, ], @@ -25452,70 +28241,162 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 14, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain.src 1`] = ` Object { - "$id": 5, + "$id": 10, "block": Object { "range": Array [ 0, - 42, + 135, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ 0, - 42, + 135, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 8, "block": Object { "range": Array [ 0, - 42, + 134, ], "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 70, + 73, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 88, + 91, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 111, + 114, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 9, }, "variableMap": Object { - "abc": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, + "one": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { @@ -25526,7 +28407,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, Object { @@ -25534,17 +28415,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "abc", + "name": "one", "range": Array [ - 14, - 38, + 25, + 34, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 42, + 134, ], "type": "FunctionDeclaration", }, @@ -25555,18 +28436,34 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "abc", + "name": "one", "range": Array [ - 14, - 38, + 25, + 34, ], "type": "Identifier", }, ], - "name": "abc", - "references": Array [], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, ], @@ -25578,15 +28475,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 10, }, "variableMap": Object { - "test": Object { + "processOptional": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { @@ -25594,17 +28491,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "test", + "name": "processOptional", "range": Array [ 9, - 13, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 42, + 134, ], "type": "FunctionDeclaration", }, @@ -25615,18 +28512,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "test", + "name": "processOptional", "range": Array [ 9, - 13, + 24, ], "type": "Identifier", }, ], - "name": "test", + "name": "processOptional", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 9, }, }, ], @@ -25640,96 +28537,375 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 10, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-call.src 1`] = ` Object { - "$id": 1, + "$id": 14, "block": Object { "range": Array [ 0, - 37, + 194, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 13, "block": Object { "range": Array [ 0, - 37, + 194, ], "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 [], + "childScopes": Array [ + Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 193, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 57, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 74, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 91, + 94, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 114, + 117, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 139, + 142, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 150, + 153, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 179, + 182, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "one": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "one", + "range": Array [ + 29, + 38, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 193, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "one", + "range": Array [ + 29, + 38, + ], + "type": "Identifier", + }, + ], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 14, + }, + "variableMap": Object { + "processOptionalCall": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 13, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processOptionalCall", + "range": Array [ + 9, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 193, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processOptionalCall", + "range": Array [ + 9, + 28, + ], + "type": "Identifier", + }, + ], + "name": "processOptionalCall", + "references": Array [], + "scope": Object { + "$ref": 13, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -25740,46 +28916,6559 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 14, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-call-with-parens.src 1`] = ` Object { - "$id": 1, + "$id": 14, "block": Object { "range": Array [ 0, - 31, + 218, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 13, "block": Object { "range": Array [ 0, - 31, + 218, ], "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 [], + "childScopes": Array [ + Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 217, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 66, + 69, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 85, + 88, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 104, + 107, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 129, + 132, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 156, + 159, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 169, + 172, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 184, + 187, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 202, + 205, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "one": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "one", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 217, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "one", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + }, + ], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "processOptionalCallParens": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processOptionalCallParens", + "range": Array [ + 9, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 217, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processOptionalCallParens", + "range": Array [ + 9, + 34, + ], + "type": "Identifier", + }, + ], + "name": "processOptionalCallParens", + "references": Array [], + "scope": Object { + "$ref": 13, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/optional-chain-element-access.src 1`] = ` +Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 142, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 142, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 141, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 59, + 62, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 74, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 89, + 92, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 104, + 107, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "one": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "one", + "range": Array [ + 32, + 41, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 141, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "one", + "range": Array [ + 32, + 41, + ], + "type": "Identifier", + }, + ], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "processOptionalElement": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processOptionalElement", + "range": Array [ + 9, + 31, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 141, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processOptionalElement", + "range": Array [ + 9, + 31, + ], + "type": "Identifier", + }, + ], + "name": "processOptionalElement", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/optional-chain-element-access-with-parens.src 1`] = ` +Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 168, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 168, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 167, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 68, + 71, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 85, + 88, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 102, + 105, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 144, + 147, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "one": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "one", + "range": Array [ + 38, + 47, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 167, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "one", + "range": Array [ + 38, + 47, + ], + "type": "Identifier", + }, + ], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "processOptionalElementParens": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processOptionalElementParens", + "range": Array [ + 9, + 37, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 167, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processOptionalElementParens", + "range": Array [ + 9, + 37, + ], + "type": "Identifier", + }, + ], + "name": "processOptionalElementParens", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/optional-chain-with-parens.src 1`] = ` +Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 182, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 182, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 181, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 101, + 104, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 126, + 129, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 152, + 155, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "one": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "one", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 181, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "one", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + ], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "processOptionalParens": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processOptionalParens", + "range": Array [ + 9, + 30, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 181, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processOptionalParens", + "range": Array [ + 9, + 30, + ], + "type": "Identifier", + }, + ], + "name": "processOptionalParens", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 45, + 60, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 45, + 60, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/readonly-arrays.src 1`] = ` +Object { + "$id": 13, + "block": Object { + "range": Array [ + 0, + 211, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 211, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 106, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "ReadonlyArray", + "range": Array [ + 18, + 31, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "arr", + "range": Array [ + 45, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "arr", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "function", + "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, + }, + }, + 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, + }, + }, + ], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 108, + 210, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "arr", + "range": Array [ + 149, + 152, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 8, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "arr", + "range": Array [ + 179, + 182, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 8, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 7, + }, + "arr": Object { + "$ref": 8, + }, + }, + "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": 8, + "defs": Array [ + Object { + "name": Object { + "name": "arr", + "range": Array [ + 121, + 143, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 108, + 210, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "arr", + "range": Array [ + 121, + 143, + ], + "type": "Identifier", + }, + ], + "name": "arr", + "references": Array [ + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 106, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + Object { + "name": Object { + "name": "foo", + "range": Array [ + 117, + 120, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 108, + 210, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + Object { + "name": "foo", + "range": Array [ + 117, + 120, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/readonly-tuples.src 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 119, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 119, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 118, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "console", + "range": Array [ + 50, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "pair", + "range": Array [ + 62, + 66, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "pair", + "range": Array [ + 84, + 88, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "pair": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "pair", + "range": Array [ + 13, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 118, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "pair", + "range": Array [ + 13, + 44, + ], + "type": "Identifier", + }, + ], + "name": "pair", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 118, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Map", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "abc": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "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": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "module", + "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", + "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 [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Success", + "range": Array [ + 17, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$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 [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "type": "type-alias", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + 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, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Result": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + ], + "name": "Result", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Success", + "range": Array [ + 28, + 35, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Failure", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "type": "type-alias", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 11, + 25, + ], + "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, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Result": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + ], + "name": "Result", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 30, + ], + "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", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-in-arrow-function.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 59, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 59, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 21, + 58, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 58, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 21, + 58, + ], + "type": "ArrowFunctionExpression", + }, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "assertString": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 58, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 58, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + ], + "name": "assertString", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-in-function.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 56, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 23, + 29, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 23, + 29, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "assertsString": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "assertsString", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "assertsString", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, + ], + "name": "assertsString", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-in-interface.src 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 61, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 61, + ], + "type": "Program", + }, + "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", + "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", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "AssertFoo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "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 [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-in-method.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 111, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 111, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 110, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 26, + 60, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + Object { + "$id": 4, + "block": Object { + "range": Array [ + 71, + 108, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "AssertsFoo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 110, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + ], + "name": "AssertsFoo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "AssertsFoo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 110, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + ], + "name": "AssertsFoo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-with-guard-in-arrow-function.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 69, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 69, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 21, + 68, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 68, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 21, + 68, + ], + "type": "ArrowFunctionExpression", + }, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "assertString": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 68, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 68, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + ], + "name": "assertString", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-with-guard-in-function.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "assertsStringGuard": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "assertsStringGuard", + "range": Array [ + 9, + 27, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "assertsStringGuard", + "range": Array [ + 9, + 27, + ], + "type": "Identifier", + }, + ], + "name": "assertsStringGuard", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-with-guard-in-interface.src 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 71, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 71, + ], + "type": "Program", + }, + "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", + "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", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "AssertFoo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "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 [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-with-guard-in-method.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 131, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 131, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 130, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 26, + 70, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + Object { + "$id": 4, + "block": Object { + "range": Array [ + 81, + 128, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "AssertsFoo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 130, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + ], + "name": "AssertsFoo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "AssertsFoo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 130, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + ], + "name": "AssertsFoo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-guard-in-arrow-function.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 79, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 79, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 17, + 78, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 17, + 78, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "isString", + "range": Array [ + 6, + 14, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 17, + 78, + ], + "type": "ArrowFunctionExpression", + }, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "isString": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "isString", + "range": Array [ + 6, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 78, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 78, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "isString", + "range": Array [ + 6, + 14, + ], + "type": "Identifier", + }, + ], + "name": "isString", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-guard-in-function.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 75, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 75, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 75, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 75, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "isString": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$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 [], + "type": "global", + "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", + "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", + "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 [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "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": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-guard-in-method.src 1`] = ` +Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 148, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 148, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 147, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 19, + 75, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 67, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + Object { + "$id": 6, + "block": Object { + "range": Array [ + 86, + 145, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 137, + 140, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 147, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 147, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` +Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 138, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 138, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 44, + 87, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "A": Object { + "$ref": 5, + }, + "arguments": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 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": 10, + "block": Object { + "range": Array [ + 88, + 137, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "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", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "A": Object { + "$ref": 8, + }, + "arguments": Object { + "$ref": 7, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$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, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$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", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 9, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "bar": Object { + "$ref": 0, + }, + "baz": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 44, + 87, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "baz", + "range": Array [ + 97, + 100, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 88, + 137, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "baz", + "range": Array [ + 97, + 100, + ], + "type": "Identifier", + }, + ], + "name": "baz", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 9, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` +Object { + "$id": 20, + "block": Object { + "range": Array [ + 0, + 339, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 19, + "block": Object { + "range": Array [ + 0, + 339, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 74, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 19, + }, + "variableMap": Object { + "foo": Object { + "$ref": 9, + }, + }, + "variableScope": Object { + "$ref": 19, + }, + "variables": Array [ + Object { + "$id": 9, + "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": 10, + }, + }, + ], + }, + Object { + "$id": 12, + "block": Object { + "range": Array [ + 75, + 164, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 19, + }, + "variableMap": Object { + "foo2": Object { + "$ref": 11, + }, + }, + "variableScope": Object { + "$ref": 19, + }, + "variables": Array [ + Object { + "$id": 11, + "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": 12, + }, + }, + ], + }, + Object { + "$id": 15, + "block": Object { + "range": Array [ + 165, + 244, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "bar2", + "range": Array [ + 212, + 216, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 229, + 230, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 19, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 19, + }, + "variables": Array [], + }, + Object { + "$id": 18, + "block": Object { + "range": Array [ + 245, + 338, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 16, + "from": Object { + "$ref": 18, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 307, + 310, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 17, + "from": Object { + "$ref": 18, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 323, + 324, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 19, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 19, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 43, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 149, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 133, + 136, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 20, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + "bar": Object { + "$ref": 3, + }, + "bar2": Object { + "$ref": 4, + }, + "foo": Object { + "$ref": 1, + }, + "foo2": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 19, + }, + "variables": Array [ + Object { + "$id": 0, + "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", + }, + Object { + "name": Object { + "name": "A", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 86, + 124, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "A", + "range": Array [ + 191, + 192, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 179, + 203, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "A", + "range": Array [ + 272, + 273, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 260, + 298, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + Object { + "name": "A", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + Object { + "name": "A", + "range": Array [ + 191, + 192, + ], + "type": "Identifier", + }, + Object { + "name": "A", + "range": Array [ + 272, + 273, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 17, + }, + ], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 74, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "foo2", + "range": Array [ + 81, + 85, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 75, + 164, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo2", + "range": Array [ + 81, + 85, + ], + "type": "Identifier", + }, + ], + "name": "foo2", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 3, + "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": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 16, + }, + ], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 4, + "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": 13, + }, + ], + "scope": Object { + "$ref": 19, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -25790,19 +35479,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 20, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion-in-arrow-function.src 1`] = ` +exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 59, + 78, ], "type": "Program", }, @@ -25812,7 +35501,7 @@ Object { "block": Object { "range": Array [ 0, - 59, + 78, ], "type": "Program", }, @@ -25821,64 +35510,86 @@ Object { "$id": 3, "block": Object { "range": Array [ - 21, - 58, + 0, + 77, ], - "type": "ArrowFunctionExpression", + "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", + "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", "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "x": Object { - "$ref": 2, + "AudioBufferList": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "x", + "name": "AudioBufferList", "range": Array [ - 22, - 28, + 6, + 21, ], "type": "Identifier", }, "node": Object { "range": Array [ - 21, - 58, + 0, + 77, ], - "type": "ArrowFunctionExpression", + "type": "ClassDeclaration", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "AudioBufferList", "range": Array [ - 22, - 28, + 6, + 21, ], "type": "Identifier", }, ], - "name": "x", + "name": "AudioBufferList", "references": Array [], "scope": Object { "$ref": 3, @@ -25889,40 +35600,18 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "assertString", - "range": Array [ - 6, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 21, - 58, - ], - "type": "ArrowFunctionExpression", - }, + "$ref": 2, }, ], - "throughReferences": Array [], "type": "module", "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "assertString": Object { + "AudioBufferList": Object { "$ref": 0, }, }, @@ -25935,47 +35624,37 @@ Object { "defs": Array [ Object { "name": Object { - "name": "assertString", + "name": "AudioBufferList", "range": Array [ 6, - 18, + 21, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 58, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 58, + 77, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "assertString", + "name": "AudioBufferList", "range": Array [ 6, - 18, + 21, ], "type": "Identifier", }, ], - "name": "assertString", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "AudioBufferList", + "references": Array [], "scope": Object { "$ref": 4, }, @@ -25986,7 +35665,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -25997,109 +35680,50 @@ Object { } `; -exports[`typescript fixtures/basics/type-assertion-in-function.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 57, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 57, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 56, + 17, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": Object { - "$ref": 2, - }, + "$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": "x", - "range": Array [ - 23, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 23, - 29, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -26108,15 +35732,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 3, }, "variableMap": Object { - "assertsString": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { @@ -26124,39 +35748,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "assertsString", + "name": "Foo", "range": Array [ - 9, - 22, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 56, + 17, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "assertsString", + "name": "Foo", "range": Array [ - 9, - 22, + 5, + 8, ], "type": "Identifier", }, ], - "name": "assertsString", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -26170,46 +35794,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion-in-interface.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 61, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 61, + 19, ], "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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -26220,166 +35914,56 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion-in-method.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 111, + 17, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ 0, - 111, + 17, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ - 0, - 110, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 26, - 60, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 4, - "block": Object { - "range": Array [ - 71, - 108, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "AssertsFoo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "AssertsFoo", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 110, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AssertsFoo", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - }, - ], - "name": "AssertsFoo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -26388,15 +35972,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 3, }, "variableMap": Object { - "AssertsFoo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, "variables": Array [ Object { @@ -26404,39 +35988,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "AssertsFoo", + "name": "Foo", "range": Array [ - 6, - 16, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 110, + 16, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "AssertsFoo", + "name": "Foo", "range": Array [ - 6, - 16, + 5, + 8, ], "type": "Identifier", }, ], - "name": "AssertsFoo", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, }, }, ], @@ -26450,144 +36034,73 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion-with-guard-in-arrow-function.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 69, + 17, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 69, + 17, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ - 21, - 68, + 0, + 16, ], - "type": "ArrowFunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 2, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 22, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 68, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 22, - 28, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "assertString", - "range": Array [ - 6, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 21, - 68, - ], - "type": "ArrowFunctionExpression", - }, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 3, }, "variableMap": Object { - "assertString": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { @@ -26595,49 +36108,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "assertString", + "name": "Foo", "range": Array [ - 6, - 18, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 68, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 68, + 16, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "assertString", + "name": "Foo", "range": Array [ - 6, - 18, + 5, + 8, ], "type": "Identifier", }, ], - "name": "assertString", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -26651,115 +36154,56 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion-with-guard-in-function.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 72, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 72, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 71, + 15, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": Object { - "$ref": 2, - }, + "$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": "x", - "range": Array [ - 28, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 28, - 34, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -26768,15 +36212,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 3, }, "variableMap": Object { - "assertsStringGuard": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { @@ -26784,39 +36228,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "assertsStringGuard", + "name": "Foo", "range": Array [ - 9, - 27, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 71, + 15, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "assertsStringGuard", + "name": "Foo", "range": Array [ - 9, - 27, + 5, + 8, ], "type": "Identifier", }, ], - "name": "assertsStringGuard", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -26830,46 +36274,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion-with-guard-in-interface.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 71, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 71, + 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -26880,166 +36394,56 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion-with-guard-in-method.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 131, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ 0, - 131, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ 0, - 130, + 17, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 26, - 70, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 4, - "block": Object { - "range": Array [ - 81, - 128, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "type-alias", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "AssertsFoo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "AssertsFoo", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 130, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "AssertsFoo", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - }, - ], - "name": "AssertsFoo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -27048,15 +36452,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 3, }, "variableMap": Object { - "AssertsFoo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, "variables": Array [ Object { @@ -27064,39 +36468,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "AssertsFoo", + "name": "Foo", "range": Array [ - 6, - 16, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 130, + 17, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "AssertsFoo", + "name": "Foo", "range": Array [ - 6, - 16, + 5, + 8, ], "type": "Identifier", }, ], - "name": "AssertsFoo", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, }, }, ], @@ -27110,168 +36514,73 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-guard-in-arrow-function.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 79, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 79, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ + 0, 17, - 78, ], - "type": "ArrowFunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 62, - 63, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "x": Object { - "$ref": 2, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 78, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "isString", - "range": Array [ - 6, - 14, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 17, - 78, - ], - "type": "ArrowFunctionExpression", - }, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 3, }, "variableMap": Object { - "isString": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -27279,49 +36588,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "isString", + "name": "Foo", "range": Array [ - 6, - 14, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 78, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 78, + 17, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "isString", + "name": "Foo", "range": Array [ - 6, - 14, + 5, + 8, ], "type": "Identifier", }, ], - "name": "isString", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -27335,139 +36634,56 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-guard-in-function.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 75, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 75, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, - 75, + 17, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "x": Object { - "$ref": 2, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 75, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -27476,15 +36692,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 3, }, "variableMap": Object { - "isString": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -27492,39 +36708,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "isString", + "name": "Foo", "range": Array [ - 9, - 17, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 75, + 17, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "isString", + "name": "Foo", "range": Array [ - 9, - 17, + 5, + 8, ], "type": "Identifier", }, ], - "name": "isString", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -27538,271 +36754,56 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-guard-in-interface.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 57, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-guard-in-method.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` Object { - "$id": 9, + "$id": 3, "block": Object { "range": Array [ 0, - 148, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 2, "block": Object { "range": Array [ 0, - 148, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 19, - 75, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 67, - 70, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - Object { - "$id": 6, - "block": Object { - "range": Array [ - 86, - 145, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 137, - 140, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], + "$id": 1, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "type-alias", "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 147, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -27811,7 +36812,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -27819,7 +36820,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 2, }, "variables": Array [ Object { @@ -27829,20 +36830,20 @@ Object { "name": Object { "name": "Foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 147, + 15, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -27850,8 +36851,8 @@ Object { Object { "name": "Foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, @@ -27859,7 +36860,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 2, }, }, ], @@ -27873,154 +36874,73 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` Object { - "$id": 8, + "$id": 3, "block": Object { "range": Array [ 0, - 138, + 21, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 2, "block": Object { "range": Array [ 0, - 138, + 21, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, - "block": Object { - "range": Array [ - 44, - 87, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ - 88, - 137, + 0, + 20, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 5, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 3, }, "variableMap": Object { - "bar": Object { + "Foo": Object { "$ref": 0, }, - "baz": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 7, + "$ref": 2, }, "variables": Array [ Object { @@ -28028,79 +36948,159 @@ Object { "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "Foo", "range": Array [ - 53, - 56, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ - 44, - 87, + 0, + 20, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", + "name": "Foo", "range": Array [ - 53, - 56, + 5, + 8, ], "type": "Identifier", }, ], - "name": "bar", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 2, }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ Object { "$id": 1, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "baz", + "name": "Foo", "range": Array [ - 97, - 100, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ - 88, - 137, + 0, + 18, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "baz", + "name": "Foo", "range": Array [ - 97, - 100, + 5, + 8, ], "type": "Identifier", }, ], - "name": "baz", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 2, }, }, ], @@ -28109,241 +37109,78 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` Object { - "$id": 9, + "$id": 3, "block": Object { "range": Array [ 0, - 339, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 2, "block": Object { "range": Array [ 0, - 339, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ 0, - 74, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "foo": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 74, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 75, - 164, + 15, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "type-alias", "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "foo2": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 164, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", - }, - ], - "name": "foo2", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 43, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 133, - 136, - ], - "type": "Identifier", + "$ref": 2, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 3, }, "variableMap": Object { - "foo": Object { + "Foo": Object { "$ref": 0, }, - "foo2": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 8, + "$ref": 2, }, "variables": Array [ Object { @@ -28351,79 +37188,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 74, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 164, + 15, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo2", + "name": "Foo", "range": Array [ - 81, - 85, + 5, + 8, ], "type": "Identifier", }, ], - "name": "foo2", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 2, }, }, ], @@ -28432,70 +37229,143 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` +exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, - 78, + 58, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, - 78, + 58, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, - 77, + 57, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", + "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", "upperScope": Object { - "$ref": 3, + "$ref": 7, }, "variableMap": Object { - "AudioBufferList": Object { + "T": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 7, }, "variables": Array [ Object { @@ -28503,39 +37373,46 @@ Object { "defs": Array [ Object { "name": Object { - "name": "AudioBufferList", + "name": "T", "range": Array [ - 6, - 21, + 41, + 42, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 77, + 40, + 43, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "AudioBufferList", + "name": "T", "range": Array [ - 6, - 21, + 41, + 42, ], "type": "Identifier", }, ], - "name": "AudioBufferList", - "references": Array [], + "name": "T", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "scope": Object { - "$ref": 2, + "$ref": 6, }, }, ], @@ -28544,18 +37421,25 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 8, }, "variableMap": Object { - "AudioBufferList": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 7, }, "variables": Array [ Object { @@ -28563,39 +37447,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "AudioBufferList", + "name": "Foo", "range": Array [ - 6, - 21, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 77, + 57, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "AudioBufferList", + "name": "Foo", "range": Array [ - 6, - 21, + 5, + 8, ], "type": "Identifier", }, ], - "name": "AudioBufferList", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -28604,101 +37488,356 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` +exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, - 18, + 90, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, - 18, + 90, ], "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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 7, + }, + "variableMap": Object { + "UIElement": Object { + "$ref": 0, + }, }, - "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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` +exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 19, + 24, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 19, + 24, ], "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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, }, - "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, @@ -28709,29 +37848,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` +exports[`typescript fixtures/basics/unknown-type-annotation.src 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 17, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, - 17, + 18, ], "type": "Program", }, @@ -28742,13 +37881,64 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 2, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 4, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 4, + 16, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28759,29 +37949,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` +exports[`typescript fixtures/basics/var-with-definite-assignment.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 17, + 50, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 17, + 50, ], "type": "Program", }, @@ -28792,13 +37982,162 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + "y": Object { + "$ref": 1, + }, + "z": Object { + "$ref": 2, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "y", + "range": Array [ + 22, + 32, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 22, + 32, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 18, + 33, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "y", + "range": Array [ + 22, + 32, + ], + "type": "Identifier", + }, + ], + "name": "y", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "z", + "range": Array [ + 38, + 48, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 38, + 48, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 34, + 49, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "z", + "range": Array [ + 38, + 48, + ], + "type": "Identifier", + }, + ], + "name": "z", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28809,15 +38148,15 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` +exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28827,7 +38166,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28838,67 +38177,303 @@ 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", "upperScope": Object { - "$ref": 1, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 4, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 4, + 14, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` +exports[`typescript fixtures/basics/var-with-type.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 18, + 55, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, - 18, + 55, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "name", + "range": Array [ + 4, + 15, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 18, + 28, + ], + "type": "Literal", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 34, + 45, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 48, + 53, + ], + "type": "Literal", + }, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 5, + }, + "variableMap": Object { + "foo": Object { + "$ref": 1, + }, + "name": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "name", + "range": Array [ + 4, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 29, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "name", + "range": Array [ + 4, + 15, + ], + "type": "Identifier", + }, + ], + "name": "name", + "references": Array [ + Object { + "$ref": 2, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 34, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 34, + 53, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 30, + 54, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 34, + 45, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28909,29 +38484,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` +exports[`typescript fixtures/basics/variable-declaration-type-annotation-spacing.src 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 18, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, - 18, + 22, ], "type": "Program", }, @@ -28942,63 +38517,64 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", + "$ref": 2, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 21, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 21, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29009,46 +38585,161 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` +exports[`typescript fixtures/declare/abstract-class.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 18, + 32, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 18, + 32, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 31, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 31, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29059,46 +38750,161 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` +exports[`typescript fixtures/declare/class.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 16, + 23, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 16, + 23, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 22, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 22, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29109,96 +38915,204 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` +exports[`typescript fixtures/declare/enum.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 21, + 38, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, - 21, + 38, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSEnumDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "enum", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Bar": Object { + "$ref": 1, + }, + "Baz": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Bar", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 23, + 26, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Bar", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + ], + "name": "Bar", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Baz", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 32, + 35, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Baz", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + ], + "name": "Baz", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", + "$ref": 5, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "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, + 37, + ], + "type": "TSEnumDeclaration", + }, + "parent": undefined, + "type": "EnumName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29209,46 +39123,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` +exports[`typescript fixtures/declare/function.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 16, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 16, + 29, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29259,46 +39243,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` +exports[`typescript fixtures/declare/interface.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 58, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 58, + 27, ], "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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -29309,46 +39363,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-this.src 1`] = ` +exports[`typescript fixtures/declare/module.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 90, + 24, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 90, + 24, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 19, + 23, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 23, + ], + "type": "TSModuleDeclaration", + }, + "parent": null, + "type": "NamespaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29359,46 +39483,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` +exports[`typescript fixtures/declare/namespace.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 24, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 24, + 27, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 22, + 26, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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": "TSModuleDeclaration", + }, + "parent": null, + "type": "NamespaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -29409,48 +39603,73 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/unknown-type-annotation.src 1`] = ` +exports[`typescript fixtures/declare/type-alias.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 18, + 26, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 18, + 26, ], "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", + "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, + "$ref": 3, }, "variableMap": Object { - "foo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -29458,45 +39677,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Foo", "range": Array [ - 4, + 13, 16, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 17, + 25, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Foo", "range": Array [ - 4, + 13, 16, ], "type": "Identifier", }, ], - "name": "foo", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -29510,29 +39723,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/var-with-definite-assignment.src 1`] = ` +exports[`typescript fixtures/declare/variable.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 50, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 50, + 22, ], "type": "Program", }, @@ -29543,21 +39756,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 2, }, "variableMap": Object { - "x": Object { + "foo": Object { "$ref": 0, }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [ Object { @@ -29565,24 +39772,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "foo", "range": Array [ - 6, - 16, + 12, + 20, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 16, + 12, + 20, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 17, + 21, ], "type": "VariableDeclaration", }, @@ -29592,110 +39799,250 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "foo", "range": Array [ - 6, - 16, + 12, + 20, ], "type": "Identifier", }, ], - "name": "x", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 1, }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 1, - "defs": Array [ + "$id": 5, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "y", + "$id": 4, + "block": Object { "range": Array [ - 22, - 32, + 48, + 70, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { - "range": Array [ - 22, - 32, - ], - "type": "VariableDeclarator", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, }, - "parent": Object { + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "configurable", "range": Array [ - 18, - 33, + 19, + 31, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "y", - "range": Array [ - 22, - 32, - ], - "type": "Identifier", + "$ref": 2, }, ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 3, + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Point": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Point", + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 72, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Point", + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + }, + ], + "name": "Point", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 2, + "$ref": 2, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Point": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "z", + "name": "Point", "range": Array [ - 38, - 48, + 6, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ - 38, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 34, - 49, + 0, + 72, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "z", + "name": "Point", "range": Array [ - 38, - 48, + 6, + 11, ], "type": "Identifier", }, ], - "name": "z", + "name": "Point", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -29704,53 +40051,194 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-static-member.src 1`] = ` Object { - "$id": 2, + "$id": 7, "block": Object { "range": Array [ 0, - 16, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, - 16, + 82, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 56, + 80, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Other": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Other", + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Other", + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + }, + ], + "name": "Other", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 7, }, "variableMap": Object { - "foo": Object { + "Other": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [ Object { @@ -29758,45 +40246,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Other", "range": Array [ - 4, - 14, + 6, + 11, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 15, + 82, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Other", "range": Array [ - 4, - 14, + 6, + 11, ], "type": "Identifier", }, ], - "name": "foo", + "name": "Other", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 6, }, }, ], @@ -29805,20 +40287,24 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/var-with-type.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -29828,7 +40314,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -29836,231 +40322,159 @@ Object { ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 4, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 28, - ], - "type": "Literal", - }, - }, + "childScopes": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 34, - 45, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { + "$id": 5, + "block": Object { "range": Array [ - 48, - 53, + 0, + 55, ], - "type": "Literal", + "type": "ClassDeclaration", }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 1, - }, - "name": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + "childScopes": Array [ Object { - "name": Object { - "name": "name", + "$id": 4, + "block": Object { "range": Array [ - 4, - 15, + 31, + 53, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, }, - "parent": Object { - "range": Array [ - 0, - 29, - ], - "type": "VariableDeclaration", + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 4, - 15, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, ], - "type": "Identifier", }, ], - "name": "name", + "functionExpressionScope": false, + "isStrict": true, "references": Array [ Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 34, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 53, - ], - "type": "VariableDeclarator", + "$id": 2, + "from": Object { + "$ref": 5, }, - "parent": Object { + "identifier": Object { + "name": "hidden", "range": Array [ - 30, - 54, + 15, + 21, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "foo", - "range": Array [ - 34, - 45, - ], - "type": "Identifier", + "$ref": 2, }, ], - "name": "foo", - "references": Array [ + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "P": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ Object { - "$ref": 3, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "P", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 55, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "P", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "P", + "references": Array [], + "scope": Object { + "$ref": 5, + }, }, ], - "scope": Object { - "$ref": 4, - }, }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/variable-declaration-type-annotation-spacing.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 7, }, "variableMap": Object { - "x": Object { + "P": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [ Object { @@ -30068,45 +40482,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "P", "range": Array [ - 4, - 21, + 6, + 7, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 55, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "P", "range": Array [ - 4, - 21, + 6, + 7, ], "type": "Identifier", }, ], - "name": "x", + "name": "P", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 6, }, }, ], @@ -30115,63 +40523,197 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/declare/abstract-class.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = ` Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ 0, - 32, + 78, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 8, "block": Object { "range": Array [ 0, - 32, + 78, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 7, "block": Object { "range": Array [ 0, - 31, + 78, ], "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 44, + 76, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "a": Object { + "$ref": 4, + }, + "arguments": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 44, + 76, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "adminonly", + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 8, }, "variableMap": Object { - "Foo": Object { + "User": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { @@ -30179,17 +40721,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "User", "range": Array [ - 23, - 26, + 6, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 31, + 78, ], "type": "ClassDeclaration", }, @@ -30200,18 +40742,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "User", "range": Array [ - 23, - 26, + 6, + 10, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "User", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 7, }, }, ], @@ -30220,18 +40762,22 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 9, }, "variableMap": Object { - "Foo": Object { + "User": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { @@ -30239,17 +40785,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "User", "range": Array [ - 23, - 26, + 6, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 31, + 78, ], "type": "ClassDeclaration", }, @@ -30260,18 +40806,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "User", "range": Array [ - 23, - 26, + 6, + 10, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "User", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, ], @@ -30280,44 +40826,48 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [], } `; -exports[`typescript fixtures/declare/class.src 1`] = ` +exports[`typescript fixtures/decorators/class-decorators/class-decorator.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 23, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 23, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 22, + 20, ], "type": "ClassDeclaration", }, @@ -30328,23 +40878,23 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "Qux": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "Qux", "range": Array [ 14, 17, @@ -30354,7 +40904,7 @@ Object { "node": Object { "range": Array [ 0, - 22, + 20, ], "type": "ClassDeclaration", }, @@ -30365,7 +40915,7 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "Qux", "range": Array [ 14, 17, @@ -30373,10 +40923,10 @@ Object { "type": "Identifier", }, ], - "name": "Foo", + "name": "Qux", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -30384,19 +40934,41 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "sealed", + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "Qux": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -30404,7 +40976,7 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "Qux", "range": Array [ 14, 17, @@ -30414,7 +40986,7 @@ Object { "node": Object { "range": Array [ 0, - 22, + 20, ], "type": "ClassDeclaration", }, @@ -30425,7 +40997,7 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "Qux", "range": Array [ 14, 17, @@ -30433,10 +41005,10 @@ Object { "type": "Identifier", }, ], - "name": "Foo", + "name": "Qux", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -30445,24 +41017,28 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/declare/enum.src 1`] = ` +exports[`typescript fixtures/decorators/class-decorators/class-decorator-factory.src 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 38, + 58, ], "type": "Program", }, @@ -30472,7 +41048,7 @@ Object { "block": Object { "range": Array [ 0, - 38, + 58, ], "type": "Program", }, @@ -30482,24 +41058,21 @@ Object { "block": Object { "range": Array [ 0, - 37, + 58, ], - "type": "TSEnumDeclaration", + "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "enum", + "type": "class", "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "Bar": Object { - "$ref": 1, - }, - "Baz": Object { + "FooComponent": Object { "$ref": 2, }, }, @@ -30507,81 +41080,41 @@ Object { "$ref": 4, }, "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Bar", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 23, - 26, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Bar", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", - }, - ], - "name": "Bar", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, Object { "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Baz", + "name": "FooComponent", "range": Array [ - 32, - 35, + 43, + 55, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 35, + 0, + 58, ], - "type": "TSEnumMember", + "type": "ClassDeclaration", }, "parent": undefined, - "type": "EnumMemberName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Baz", + "name": "FooComponent", "range": Array [ - 32, - 35, + 43, + 55, ], "type": "Identifier", }, ], - "name": "Baz", + "name": "FooComponent", "references": Array [], "scope": Object { "$ref": 3, @@ -30590,311 +41123,43 @@ Object { ], }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSEnumDeclaration", - }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/declare/function.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/declare/interface.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/declare/module.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { "$id": 1, - "block": Object { + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Component", "range": Array [ - 19, - 23, + 1, + 10, ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, + "type": "Identifier", }, - "variables": Array [], + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "FooComponent": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [ Object { @@ -30902,39 +41167,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "FooComponent", "range": Array [ - 15, - 18, + 43, + 55, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 23, + 58, ], - "type": "TSModuleDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "NamespaceName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "FooComponent", "range": Array [ - 15, - 18, + 43, + 55, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "FooComponent", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -30943,78 +41208,194 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/declare/namespace.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = ` Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, - 27, + 57, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, - 27, + 57, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ - 22, - 26, + 0, + 56, ], - "type": "TSModuleBlock", + "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 49, + 54, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "onlyRead", + "range": Array [ + 15, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "class", "upperScope": Object { - "$ref": 2, + "$ref": 6, + }, + "variableMap": Object { + "B": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "B": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [ Object { @@ -31022,39 +41403,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "B", "range": Array [ - 18, - 21, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 26, + 56, ], - "type": "TSModuleDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "NamespaceName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "B", "range": Array [ - 18, - 21, + 6, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "B", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 6, }, }, ], @@ -31063,103 +41444,194 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/declare/type-alias.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 2, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/declare/variable.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = ` Object { - "$id": 2, + "$id": 7, "block": Object { "range": Array [ 0, - 22, + 57, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, - 22, + 57, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 56, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 49, + 54, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "C": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 7, }, "variableMap": Object { - "foo": Object { + "C": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [ Object { @@ -31167,45 +41639,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "C", "range": Array [ - 12, - 20, + 6, + 7, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 12, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 21, + 56, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "C", "range": Array [ - 12, - 20, + 6, + 7, ], "type": "Identifier", }, ], - "name": "foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 6, }, }, ], @@ -31214,24 +41680,28 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-instance-member.src 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 72, + 50, ], "type": "Program", }, @@ -31241,7 +41711,7 @@ Object { "block": Object { "range": Array [ 0, - 72, + 50, ], "type": "Program", }, @@ -31251,7 +41721,7 @@ Object { "block": Object { "range": Array [ 0, - 72, + 49, ], "type": "ClassDeclaration", }, @@ -31260,8 +41730,8 @@ Object { "$id": 4, "block": Object { "range": Array [ - 48, - 70, + 42, + 47, ], "type": "FunctionExpression", }, @@ -31306,10 +41776,10 @@ Object { "$ref": 5, }, "identifier": Object { - "name": "configurable", + "name": "onlyRead", "range": Array [ - 19, - 31, + 15, + 23, ], "type": "Identifier", }, @@ -31328,7 +41798,7 @@ Object { "$ref": 6, }, "variableMap": Object { - "Point": Object { + "A": Object { "$ref": 1, }, }, @@ -31341,17 +41811,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Point", + "name": "A", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 72, + 49, ], "type": "ClassDeclaration", }, @@ -31362,15 +41832,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Point", + "name": "A", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, ], - "name": "Point", + "name": "A", "references": Array [], "scope": Object { "$ref": 5, @@ -31392,7 +41862,7 @@ Object { "$ref": 7, }, "variableMap": Object { - "Point": Object { + "A": Object { "$ref": 0, }, }, @@ -31405,17 +41875,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Point", + "name": "A", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 72, + 49, ], "type": "ClassDeclaration", }, @@ -31426,15 +41896,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Point", + "name": "A", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, ], - "name": "Point", + "name": "A", "references": Array [], "scope": Object { "$ref": 6, @@ -31461,13 +41931,13 @@ Object { } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-static-member.src 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 82, + 50, ], "type": "Program", }, @@ -31477,7 +41947,7 @@ Object { "block": Object { "range": Array [ 0, - 82, + 50, ], "type": "Program", }, @@ -31487,7 +41957,7 @@ Object { "block": Object { "range": Array [ 0, - 82, + 49, ], "type": "ClassDeclaration", }, @@ -31496,8 +41966,8 @@ Object { "$id": 4, "block": Object { "range": Array [ - 56, - 80, + 42, + 47, ], "type": "FunctionExpression", }, @@ -31542,10 +42012,10 @@ Object { "$ref": 5, }, "identifier": Object { - "name": "foo", + "name": "Foo", "range": Array [ - 19, - 22, + 15, + 18, ], "type": "Identifier", }, @@ -31564,7 +42034,7 @@ Object { "$ref": 6, }, "variableMap": Object { - "Other": Object { + "D": Object { "$ref": 1, }, }, @@ -31577,17 +42047,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Other", + "name": "D", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 49, ], "type": "ClassDeclaration", }, @@ -31598,15 +42068,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Other", + "name": "D", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, ], - "name": "Other", + "name": "D", "references": Array [], "scope": Object { "$ref": 5, @@ -31628,7 +42098,7 @@ Object { "$ref": 7, }, "variableMap": Object { - "Other": Object { + "D": Object { "$ref": 0, }, }, @@ -31641,17 +42111,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Other", + "name": "D", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 49, ], "type": "ClassDeclaration", }, @@ -31662,15 +42132,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Other", + "name": "D", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, ], - "name": "Other", + "name": "D", "references": Array [], "scope": Object { "$ref": 6, @@ -31697,73 +42167,138 @@ Object { } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-array-pattern-decorator.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, - 55, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, - 55, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, - 55, + 51, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ - 31, - 53, + 17, + 49, ], "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "special", + "range": Array [ + 19, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "arguments": Object { + "$ref": 2, + }, + "bar": Object { "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 17, + 49, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [], + "scope": Object { + "$ref": 5, }, }, ], @@ -31771,41 +42306,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "hidden", - "range": Array [ - 15, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "P": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -31813,17 +42330,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "P", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 55, + 51, ], "type": "ClassDeclaration", }, @@ -31834,18 +42351,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "P", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "P", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -31856,20 +42373,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { - "P": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -31877,17 +42394,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "P", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 55, + 51, ], "type": "ClassDeclaration", }, @@ -31898,18 +42415,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "P", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "P", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -31920,56 +42437,56 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` Object { - "$id": 9, + "$id": 11, "block": Object { "range": Array [ 0, - 78, + 116, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, - 78, + 116, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, - 78, + 115, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ - 44, - 76, + 31, + 113, ], "type": "FunctionExpression", }, @@ -31977,70 +42494,131 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Inject", + "range": Array [ + 33, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, Object { "$id": 5, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { - "name": "a", + "name": "APP_CONFIG", "range": Array [ - 68, + 40, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$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", + "range": Array [ + 94, + 100, + ], + "type": "Identifier", + }, + "kind": "r", "resolved": Object { - "$ref": 4, + "$ref": 3, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "a": Object { - "$ref": 4, - }, "arguments": Object { + "$ref": 2, + }, + "config": Object { "$ref": 3, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, Object { - "$id": 4, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "config", "range": Array [ - 45, - 46, + 52, + 69, ], "type": "Identifier", }, "node": Object { "range": Array [ - 44, - 76, + 31, + 113, ], "type": "FunctionExpression", }, @@ -32051,22 +42629,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "config", "range": Array [ - 45, - 46, + 52, + 69, ], "type": "Identifier", }, ], - "name": "a", + "name": "config", "references": Array [ Object { - "$ref": 5, + "$ref": 7, }, ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -32074,41 +42652,29 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "adminonly", - "range": Array [ - 18, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "$ref": 4, }, - ], - "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 5, + }, + Object { + "$ref": 6, }, ], "type": "class", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { - "User": Object { + "Service": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [ Object { @@ -32116,17 +42682,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "User", + "name": "Service", "range": Array [ 6, - 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 78, + 115, ], "type": "ClassDeclaration", }, @@ -32137,18 +42703,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "User", + "name": "Service", "range": Array [ 6, - 10, + 13, ], "type": "Identifier", }, ], - "name": "User", + "name": "Service", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -32159,20 +42725,26 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 11, }, "variableMap": Object { - "User": Object { + "Service": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [ Object { @@ -32180,17 +42752,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "User", + "name": "Service", "range": Array [ 6, - 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 78, + 115, ], "type": "ClassDeclaration", }, @@ -32201,18 +42773,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "User", + "name": "Service", "range": Array [ 6, - 10, + 13, ], "type": "Identifier", }, ], - "name": "User", + "name": "Service", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 10, }, }, ], @@ -32223,274 +42795,199 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 11, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/class-decorators/class-decorator.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src 1`] = ` Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, - 20, + 53, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, - 20, + 53, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 20, + 52, ], "type": "ClassDeclaration", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Qux": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 2, - "defs": Array [ + "$id": 5, + "block": Object { + "range": Array [ + 19, + 50, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "Qux", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", + "$id": 4, + "from": Object { + "$ref": 5, }, - "node": Object { + "identifier": Object { + "name": "special", "range": Array [ - 0, - 20, + 21, + 28, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "Qux", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", + "$ref": 4, }, ], - "name": "Qux", - "references": Array [], - "scope": Object { - "$ref": 3, + "type": "function", + "upperScope": Object { + "$ref": 6, }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "sealed", - "range": Array [ - 1, - 7, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Qux": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Qux", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "baz": Object { + "$ref": 3, + }, }, - "node": Object { - "range": Array [ - 0, - 20, - ], - "type": "ClassDeclaration", + "variableScope": Object { + "$ref": 5, }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Qux", - "range": Array [ - 14, - 17, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "baz", + "range": Array [ + 35, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 50, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "baz", + "range": Array [ + 35, + 46, + ], + "type": "Identifier", + }, + ], + "name": "baz", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, ], - "type": "Identifier", }, ], - "name": "Qux", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/decorators/class-decorators/class-decorator-factory.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { - "FooComponent": Object { - "$ref": 2, + "Foo": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "FooComponent", + "name": "Foo", "range": Array [ - 43, - 55, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 58, + 52, ], "type": "ClassDeclaration", }, @@ -32501,18 +42998,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "FooComponent", + "name": "Foo", "range": Array [ - 43, - 55, + 6, + 9, ], "type": "Identifier", }, ], - "name": "FooComponent", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -32520,41 +43017,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Component", - "range": Array [ - 1, - 10, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { - "FooComponent": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -32562,17 +43041,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "FooComponent", + "name": "Foo", "range": Array [ - 43, - 55, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 58, + 52, ], "type": "ClassDeclaration", }, @@ -32583,18 +43062,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "FooComponent", + "name": "Foo", "range": Array [ - 43, - 55, + 6, + 9, ], "type": "Identifier", }, ], - "name": "FooComponent", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -32605,86 +43084,151 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, - 57, + 66, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, - 57, + 66, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, - 56, + 65, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ - 49, - 54, + 32, + 63, ], "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "special", + "range": Array [ + 34, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "arguments": Object { + "$ref": 2, + }, + "baz": Object { "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "baz", + "range": Array [ + 48, + 59, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 32, + 63, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "baz", + "range": Array [ + 48, + 59, + ], + "type": "Identifier", + }, + ], + "name": "baz", + "references": Array [], + "scope": Object { + "$ref": 5, }, }, ], @@ -32692,41 +43236,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "onlyRead", - "range": Array [ - 15, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "B": Object { + "StaticFoo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -32734,17 +43260,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "B", + "name": "StaticFoo", "range": Array [ 6, - 7, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 56, + 65, ], "type": "ClassDeclaration", }, @@ -32755,18 +43281,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "StaticFoo", "range": Array [ 6, - 7, + 15, ], "type": "Identifier", }, ], - "name": "B", + "name": "StaticFoo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -32777,20 +43303,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { - "B": Object { + "StaticFoo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -32798,17 +43324,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "B", + "name": "StaticFoo", "range": Array [ 6, - 7, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 56, + 65, ], "type": "ClassDeclaration", }, @@ -32819,18 +43345,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "StaticFoo", "range": Array [ 6, - 7, + 15, ], "type": "Identifier", }, ], - "name": "B", + "name": "StaticFoo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -32841,86 +43367,174 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-instance-member.src 1`] = ` Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, - 57, + 98, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, - 57, + 98, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, - 56, + 97, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ - 49, - 54, + 25, + 95, ], "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "required", + "range": Array [ + 27, + 35, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "name", + "range": Array [ + 78, + 82, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { "arguments": Object { + "$ref": 2, + }, + "name": Object { "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "name", + "range": Array [ + 36, + 48, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 95, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "name", + "range": Array [ + 36, + 48, + ], + "type": "Identifier", + }, + ], + "name": "name", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, }, }, ], @@ -32928,41 +43542,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { - "C": Object { + "Greeter": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [ Object { @@ -32970,17 +43566,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Greeter", "range": Array [ 6, - 7, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 56, + 97, ], "type": "ClassDeclaration", }, @@ -32991,18 +43587,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Greeter", "range": Array [ 6, - 7, + 13, ], "type": "Identifier", }, ], - "name": "C", + "name": "Greeter", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -33013,20 +43609,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "C": Object { + "Greeter": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [ Object { @@ -33034,17 +43630,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Greeter", "range": Array [ 6, - 7, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 56, + 97, ], "type": "ClassDeclaration", }, @@ -33055,18 +43651,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Greeter", "range": Array [ 6, - 7, + 13, ], "type": "Identifier", }, ], - "name": "C", + "name": "Greeter", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -33077,86 +43673,174 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/method-decorators/method-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-static-member.src 1`] = ` Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, - 50, + 111, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, - 50, + 111, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, - 49, + 110, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ - 42, - 47, + 38, + 108, ], "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "required", + "range": Array [ + 40, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "name", + "range": Array [ + 91, + 95, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { "arguments": Object { + "$ref": 2, + }, + "name": Object { "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "name", + "range": Array [ + 49, + 61, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 38, + 108, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "name", + "range": Array [ + 49, + 61, + ], + "type": "Identifier", + }, + ], + "name": "name", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, }, }, ], @@ -33164,41 +43848,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "onlyRead", - "range": Array [ - 15, - 23, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { - "A": Object { + "StaticGreeter": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [ Object { @@ -33206,17 +43872,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "StaticGreeter", "range": Array [ 6, - 7, + 19, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 49, + 110, ], "type": "ClassDeclaration", }, @@ -33227,18 +43893,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "StaticGreeter", "range": Array [ 6, - 7, + 19, ], "type": "Identifier", }, ], - "name": "A", + "name": "StaticGreeter", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -33249,20 +43915,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "A": Object { + "StaticGreeter": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [ Object { @@ -33270,17 +43936,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "StaticGreeter", "range": Array [ 6, - 7, + 19, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 49, + 110, ], "type": "ClassDeclaration", }, @@ -33291,18 +43957,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "StaticGreeter", "range": Array [ 6, - 7, + 19, ], "type": "Identifier", }, ], - "name": "A", + "name": "StaticGreeter", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -33313,86 +43979,151 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/method-decorators/method-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-object-pattern-decorator.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, - 50, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, - 50, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, - 49, + 51, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ - 42, - 47, + 17, + 49, ], "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "special", + "range": Array [ + 19, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "arguments": Object { + "$ref": 2, + }, + "bar": Object { "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$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 [], + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 17, + 49, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + ], + "name": "bar", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -33400,41 +44131,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "D": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -33442,17 +44155,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "D", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 49, + 51, ], "type": "ClassDeclaration", }, @@ -33463,18 +44176,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "D", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "D", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -33485,20 +44198,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { - "D": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -33506,17 +44219,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "D", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 49, + 51, ], "type": "ClassDeclaration", }, @@ -33527,18 +44240,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "D", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "D", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -33549,26 +44262,26 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-array-pattern-decorator.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-rest-element-decorator.src 1`] = ` Object { "$id": 8, "block": Object { "range": Array [ 0, - 52, + 51, ], "type": "Program", }, @@ -33578,7 +44291,7 @@ Object { "block": Object { "range": Array [ 0, - 52, + 51, ], "type": "Program", }, @@ -33588,7 +44301,7 @@ Object { "block": Object { "range": Array [ 0, - 51, + 50, ], "type": "ClassDeclaration", }, @@ -33598,7 +44311,7 @@ Object { "block": Object { "range": Array [ 17, - 49, + 48, ], "type": "FunctionExpression", }, @@ -33637,7 +44350,7 @@ Object { "arguments": Object { "$ref": 2, }, - "bar": Object { + "foo": Object { "$ref": 3, }, }, @@ -33661,17 +44374,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "foo", "range": Array [ - 35, - 38, + 36, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ 17, - 49, + 48, ], "type": "FunctionExpression", }, @@ -33682,15 +44395,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", + "name": "foo", "range": Array [ - 35, - 38, + 36, + 39, ], "type": "Identifier", }, ], - "name": "bar", + "name": "foo", "references": Array [], "scope": Object { "$ref": 5, @@ -33735,7 +44448,7 @@ Object { "node": Object { "range": Array [ 0, - 51, + 50, ], "type": "ClassDeclaration", }, @@ -33799,7 +44512,7 @@ Object { "node": Object { "range": Array [ 0, - 51, + 50, ], "type": "ClassDeclaration", }, @@ -33845,208 +44558,341 @@ Object { } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` +exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-instance-member.src 1`] = ` Object { - "$id": 10, + "$id": 7, "block": Object { "range": Array [ 0, - 116, + 88, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 6, "block": Object { "range": Array [ 0, - 116, + 88, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 115, + 88, ], "type": "ClassDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 7, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Input", "range": Array [ - 31, - 113, + 27, + 32, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "Inject", - "range": Array [ - 33, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Output", + "range": Array [ + 46, + 52, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "EventEmitter", + "range": Array [ + 71, + 83, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "SomeComponent": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ Object { - "$id": 5, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "APP_CONFIG", + "name": Object { + "name": "SomeComponent", "range": Array [ - 40, - 50, + 6, + 19, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "config", + "node": Object { "range": Array [ - 94, - 100, + 0, + 88, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, + "type": "ClassDeclaration", }, - "writeExpr": undefined, + "parent": undefined, + "type": "ClassName", }, ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 5, + "name": "SomeComponent", + "range": Array [ + 6, + 19, + ], + "type": "Identifier", }, ], - "type": "function", - "upperScope": Object { - "$ref": 8, + "name": "SomeComponent", + "references": Array [], + "scope": Object { + "$ref": 5, }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "SomeComponent": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "SomeComponent", + "range": Array [ + 6, + 19, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 7, + "node": Object { + "range": Array [ + 0, + 88, + ], + "type": "ClassDeclaration", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "config", - "range": Array [ - 52, - 69, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 31, - 113, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "config", - "range": Array [ - 52, - 69, - ], - "type": "Identifier", - }, - ], - "name": "config", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "SomeComponent", + "range": Array [ + 6, + 19, ], + "type": "Identifier", + }, + ], + "name": "SomeComponent", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-static-member.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 93, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 93, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 93, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "configurable", + "range": Array [ + 15, + 27, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "configurable", + "range": Array [ + 54, + 66, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, }, Object { - "$ref": 5, + "$ref": 3, }, ], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 5, }, "variableMap": Object { - "Service": Object { + "A": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 5, }, "variables": Array [ Object { @@ -34054,17 +44900,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Service", + "name": "A", "range": Array [ 6, - 13, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 115, + 93, ], "type": "ClassDeclaration", }, @@ -34075,18 +44921,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Service", + "name": "A", "range": Array [ 6, - 13, + 7, ], "type": "Identifier", }, ], - "name": "Service", + "name": "A", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 4, }, }, ], @@ -34097,23 +44943,23 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, }, Object { - "$ref": 5, + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 6, }, "variableMap": Object { - "Service": Object { + "A": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 5, }, "variables": Array [ Object { @@ -34121,17 +44967,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Service", + "name": "A", "range": Array [ 6, - 13, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 115, + 93, ], "type": "ClassDeclaration", }, @@ -34142,18 +44988,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Service", + "name": "A", "range": Array [ 6, - 13, + 7, ], "type": "Identifier", }, ], - "name": "Service", + "name": "A", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 5, }, }, ], @@ -34164,178 +45010,110 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, }, Object { - "$ref": 5, + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/property-decorators/property-decorator-instance-member.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, - 53, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, - 53, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, - 52, + 39, ], "type": "ClassDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 5, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 19, - 50, + 15, + 18, ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 21, - 28, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "baz": Object { - "$ref": 3, - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, }, - "variableScope": Object { - "$ref": 5, + "identifier": Object { + "name": "bar", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 35, - 46, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 50, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 35, - 46, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "B": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { @@ -34343,17 +45121,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "B", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 52, + 39, ], "type": "ClassDeclaration", }, @@ -34364,18 +45142,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "B", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "B", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 4, }, }, ], @@ -34386,20 +45164,23 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 6, }, "variableMap": Object { - "Foo": Object { + "B": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { @@ -34407,17 +45188,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "B", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 52, + 39, ], "type": "ClassDeclaration", }, @@ -34428,18 +45209,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "B", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "B", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 5, }, }, ], @@ -34450,175 +45231,289 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/property-decorators/property-decorator-static-member.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, - 66, + 54, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, - 66, + 54, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, - 65, + 53, ], "type": "ClassDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 5, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "baz", "range": Array [ - 32, - 63, + 15, + 18, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "qux", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "C": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", + "name": Object { + "name": "C", "range": Array [ - 34, - 41, + 6, + 7, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "node": Object { + "range": Array [ + 0, + 53, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", }, ], - "throughReferences": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 4, + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "baz": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 4, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 63, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "C": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 53, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 6, + 7, ], + "type": "Identifier", }, ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/class-empty-extends.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 23, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 23, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 3, }, "variableMap": Object { - "StaticFoo": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 3, }, "variables": Array [ Object { @@ -34626,17 +45521,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "StaticFoo", + "name": "Foo", "range": Array [ 6, - 15, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 65, + 22, ], "type": "ClassDeclaration", }, @@ -34647,18 +45542,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "StaticFoo", + "name": "Foo", "range": Array [ 6, - 15, + 9, ], "type": "Identifier", }, ], - "name": "StaticFoo", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, }, }, ], @@ -34667,22 +45562,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 4, }, "variableMap": Object { - "StaticFoo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 3, }, "variables": Array [ Object { @@ -34690,17 +45581,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "StaticFoo", + "name": "Foo", "range": Array [ 6, - 15, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 65, + 22, ], "type": "ClassDeclaration", }, @@ -34711,18 +45602,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "StaticFoo", + "name": "Foo", "range": Array [ 6, - 15, + 9, ], "type": "Identifier", }, ], - "name": "StaticFoo", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 3, }, }, ], @@ -34731,218 +45622,81 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/class-empty-extends-implements.src 1`] = ` Object { - "$id": 9, + "$id": 5, "block": Object { "range": Array [ 0, - 98, + 38, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 4, "block": Object { "range": Array [ 0, - 98, + 38, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 97, + 37, ], "type": "ClassDeclaration", }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 25, - 95, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "required", - "range": Array [ - 27, - 35, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 78, - 82, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "name": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "name", - "range": Array [ - 36, - 48, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 95, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 36, - 48, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 8, + "$ref": 4, }, "variableMap": Object { - "Greeter": Object { - "$ref": 1, + "Foo": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Greeter", + "name": "Foo", "range": Array [ 6, - 13, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 97, + 37, ], "type": "ClassDeclaration", }, @@ -34953,18 +45707,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Greeter", + "name": "Foo", "range": Array [ 6, - 13, + 9, ], "type": "Identifier", }, ], - "name": "Greeter", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 3, }, }, ], @@ -34972,23 +45726,41 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 5, }, "variableMap": Object { - "Greeter": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, "variables": Array [ Object { @@ -34996,17 +45768,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Greeter", + "name": "Foo", "range": Array [ 6, - 13, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 97, + 37, ], "type": "ClassDeclaration", }, @@ -35017,18 +45789,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Greeter", + "name": "Foo", "range": Array [ 6, - 13, + 9, ], "type": "Identifier", }, ], - "name": "Greeter", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 4, }, }, ], @@ -35039,216 +45811,83 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/class-extends-empty-implements.src 1`] = ` Object { - "$id": 9, + "$id": 5, "block": Object { "range": Array [ 0, - 111, + 38, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 4, "block": Object { "range": Array [ 0, - 111, + 38, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 110, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 38, - 108, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "required", - "range": Array [ - 40, - 48, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "name", - "range": Array [ - 91, - 95, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "name": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "name", - "range": Array [ - 49, - 61, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 38, - 108, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 49, - 61, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], + 37, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 8, + "$ref": 4, }, "variableMap": Object { - "StaticGreeter": Object { - "$ref": 1, + "Foo": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "StaticGreeter", + "name": "Foo", "range": Array [ 6, - 19, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 110, + 37, ], "type": "ClassDeclaration", }, @@ -35259,18 +45898,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "StaticGreeter", + "name": "Foo", "range": Array [ 6, - 19, + 9, ], "type": "Identifier", }, ], - "name": "StaticGreeter", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 3, }, }, ], @@ -35278,23 +45917,41 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 5, }, "variableMap": Object { - "StaticGreeter": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, "variables": Array [ Object { @@ -35302,17 +45959,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "StaticGreeter", + "name": "Foo", "range": Array [ 6, - 19, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 110, + 37, ], "type": "ClassDeclaration", }, @@ -35323,18 +45980,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "StaticGreeter", + "name": "Foo", "range": Array [ 6, - 19, + 9, ], "type": "Identifier", }, ], - "name": "StaticGreeter", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 4, }, }, ], @@ -35345,193 +46002,83 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-object-pattern-decorator.src 1`] = ` +exports[`typescript fixtures/errorRecovery/class-multiple-implements.src 1`] = ` Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 52, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 52, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 51, + 36, ], "type": "ClassDeclaration", }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 49, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "bar": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 49, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 51, + 36, ], "type": "ClassDeclaration", }, @@ -35542,18 +46089,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "a", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], @@ -35561,23 +46108,41 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -35585,17 +46150,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 51, + 36, ], "type": "ClassDeclaration", }, @@ -35606,18 +46171,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "a", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], @@ -35628,239 +46193,80 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-rest-element-decorator.src 1`] = ` +exports[`typescript fixtures/errorRecovery/decorator-on-enum-declaration.src 1`] = ` Object { - "$id": 8, + "$id": 3, "block": Object { "range": Array [ 0, - 51, + 14, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 2, "block": Object { "range": Array [ 0, - 51, + 14, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 50, + 14, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 48, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 48, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", + "throughReferences": Array [], + "type": "enum", "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 50, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 3, }, "variableMap": Object { - "Foo": Object { + "E": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 2, }, "variables": Array [ Object { @@ -35868,39 +46274,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "E", "range": Array [ - 6, - 9, + 10, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 50, + 14, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "ClassName", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "E", "range": Array [ - 6, - 9, + 10, + 11, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "E", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 2, }, }, ], @@ -35909,169 +46315,74 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-instance-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/decorator-on-function.src 1`] = ` Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 88, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 88, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 88, + 19, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Input", - "range": Array [ - 27, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Output", - "range": Array [ - 46, - 52, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "EventEmitter", - "range": Array [ - 71, - 83, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "class", + "references": Array [], + "throughReferences": Array [], + "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 3, }, "variableMap": Object { - "SomeComponent": Object { + "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, "variables": Array [ Object { "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "SomeComponent", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 88, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "SomeComponent", - "range": Array [ - 6, - 19, - ], - "type": "Identifier", - }, - ], - "name": "SomeComponent", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -36080,28 +46391,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object { - "SomeComponent": Object { + "b": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [ Object { @@ -36109,39 +46410,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "SomeComponent", + "name": "b", "range": Array [ - 6, - 19, + 14, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 88, + 19, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "SomeComponent", + "name": "b", "range": Array [ - 6, - 19, + 14, + 15, ], "type": "Identifier", }, ], - "name": "SomeComponent", + "name": "b", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], @@ -36150,182 +46451,78 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-static-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 93, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 93, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, - 93, + 22, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "configurable", - "range": Array [ - 15, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "configurable", - "range": Array [ - 54, - 66, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "class", + "references": Array [], + "throughReferences": Array [], + "type": "interface", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 93, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 3, }, "variableMap": Object { - "A": Object { + "M": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -36333,39 +46530,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "M", "range": Array [ - 6, - 7, + 18, + 19, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 93, + 22, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "ClassName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "M", "range": Array [ - 6, - 7, + 18, + 19, ], "type": "Identifier", }, ], - "name": "A", + "name": "M", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -36374,179 +46571,79 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/decorator-on-variable.src 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 39, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 39, + 20, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 4, - "block": Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", "range": Array [ - 0, - 39, + 14, + 15, ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 5, + "type": "Identifier", }, - "variableMap": Object { - "B": Object { - "$ref": 1, - }, + "kind": "w", + "resolved": Object { + "$ref": 0, }, - "variableScope": Object { - "$ref": 5, + "writeExpr": Object { + "range": Array [ + 18, + 19, + ], + "type": "Literal", }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 39, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, }, ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 3, }, "variableMap": Object { - "B": Object { + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -36554,39 +46651,49 @@ Object { "defs": Array [ Object { "name": Object { - "name": "B", + "name": "a", "range": Array [ - 6, - 7, + 14, + 15, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 14, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 39, + 19, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "a", "range": Array [ - 6, - 7, + 14, + 15, ], "type": "Identifier", }, ], - "name": "B", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -36595,179 +46702,75 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 54, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 54, + 16, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 4, - "block": Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Foo", "range": Array [ - 0, - 53, + 11, + 14, ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "qux", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 53, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 3, }, "variableMap": Object { - "C": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -36775,39 +46778,45 @@ Object { "defs": Array [ Object { "name": Object { - "name": "C", + "name": "foo", "range": Array [ 6, - 7, + 16, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 53, + 16, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "foo", "range": Array [ 6, - 7, + 16, ], "type": "Identifier", }, ], - "name": "C", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -36818,194 +46827,178 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/class-empty-extends.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-arguments-in-call-expression.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 23, + 9, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 23, + 9, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 2, - "block": Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "foo", "range": Array [ 0, - 22, + 3, ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { + "throughReferences": Array [ + Object { "$ref": 0, }, + ], + "type": "module", + "upperScope": Object { + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, - "variables": Array [ + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-arguments-in-new-expression.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 12, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 12, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 22, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 3, + "from": Object { + "$ref": 1, }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, }, ], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/class-empty-extends-implements.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 38, + 19, ], "type": "Program", }, @@ -37015,7 +47008,7 @@ Object { "block": Object { "range": Array [ 0, - 38, + 19, ], "type": "Program", }, @@ -37025,63 +47018,34 @@ Object { "block": Object { "range": Array [ 0, - 37, + 18, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "function", "upperScope": Object { "$ref": 3, }, "variableMap": Object { - "Foo": Object { + "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { "$ref": 2, @@ -37099,7 +47063,7 @@ Object { "$ref": 4, }, "variableMap": Object { - "Foo": Object { + "f1": Object { "$ref": 0, }, }, @@ -37112,36 +47076,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "f1", "range": Array [ - 6, 9, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 37, + 18, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "f1", "range": Array [ - 6, 9, + 11, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "f1", "references": Array [], "scope": Object { "$ref": 3, @@ -37164,92 +47128,63 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/class-extends-empty-implements.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-arrow-function.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, - 38, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 38, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 37, + 18, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "Foo": Object { - "$ref": 2, + "arguments": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], + "$id": 1, + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -37257,41 +47192,19 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { - "Foo": Object { + "f1": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -37299,39 +47212,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "f1", "range": Array [ - 6, 9, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 37, + 18, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "f1", "range": Array [ - 6, 9, + 11, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "f1", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -37340,67 +47253,104 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/class-multiple-implements.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-constructor.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 37, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 37, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 36, + 34, ], "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 25, + 32, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "a": Object { + "foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -37408,17 +47358,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 36, + 34, ], "type": "ClassDeclaration", }, @@ -37429,18 +47379,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "a", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -37452,15 +47402,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { - "a": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -37468,17 +47418,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 36, + 34, ], "type": "ClassDeclaration", }, @@ -37489,18 +47439,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "a", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -37514,73 +47464,115 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/decorator-on-enum-declaration.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-function-expression.src 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 14, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 14, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ - 0, - 14, + 12, + 27, ], - "type": "TSEnumDeclaration", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "enum", + "type": "function", "upperScope": Object { - "$ref": 2, + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 27, + ], + "type": "FunctionExpression", + }, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "E": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [ Object { @@ -37588,39 +47580,49 @@ Object { "defs": Array [ Object { "name": Object { - "name": "E", + "name": "foo", "range": Array [ - 10, - 11, + 6, + 9, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 14, + 27, ], - "type": "TSEnumDeclaration", + "type": "VariableDeclaration", }, - "parent": undefined, - "type": "EnumName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "E", + "name": "foo", "range": Array [ - 10, - 11, + 6, + 9, ], "type": "Identifier", }, ], - "name": "E", - "references": Array [], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -37634,69 +47636,139 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/decorator-on-function.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 20, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 20, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 19, + 27, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 18, + 25, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "arguments": Object { + "foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [ Object { "$id": 1, - "defs": Array [], + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 27, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -37708,15 +47780,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { - "b": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -37724,92 +47796,42 @@ Object { "defs": Array [ Object { "name": Object { - "name": "b", + "name": "foo", "range": Array [ - 14, - 15, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 19, + 27, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "b", + "name": "foo", "range": Array [ - 14, - 15, + 6, + 9, ], "type": "Identifier", }, ], - "name": "b", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + }, + ], }, ], "functionExpressionScope": false, @@ -37820,19 +47842,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/decorator-on-variable.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 20, + 30, ], "type": "Program", }, @@ -37842,47 +47864,46 @@ Object { "block": Object { "range": Array [ 0, - 20, + 30, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", + "block": Object { "range": Array [ - 14, - 15, + 0, + 29, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "upperScope": Object { + "$ref": 2, }, - "writeExpr": Object { - "range": Array [ - 18, - 19, - ], - "type": "Literal", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, }, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { "$ref": 3, }, "variableMap": Object { - "a": Object { + "foo": Object { "$ref": 0, }, }, @@ -37895,47 +47916,37 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "foo", "range": Array [ - 14, - 15, + 10, + 13, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 14, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 19, + 29, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "foo", "range": Array [ - 14, - 15, + 10, + 13, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "foo", + "references": Array [], "scope": Object { "$ref": 2, }, @@ -37957,42 +47968,67 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` +exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 16, + 72, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 16, + 72, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 7, + 72, + ], + "type": "TSEnumDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "enum", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { - "foo": Object { + "X": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -38000,45 +48036,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "X", "range": Array [ - 6, - 16, + 68, + 69, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 16, + 7, + 72, ], - "type": "VariableDeclaration", + "type": "TSEnumDeclaration", }, - "type": "Variable", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "X", "range": Array [ - 6, - 16, + 68, + 69, ], "type": "Identifier", }, ], - "name": "foo", + "name": "X", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -38052,68 +48082,165 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-arguments-in-call-expression.src 1`] = ` +exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 9, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 9, + 49, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", + "$id": 3, + "block": Object { "range": Array [ 0, - 3, + 48, ], - "type": "Identifier", + "type": "TSTypeAliasDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "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": "b", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "type-alias", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 5, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, + 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": 4, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -38121,155 +48248,186 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-arguments-in-new-expression.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 12, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 12, + 27, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "Foo", + "$id": 1, + "block": Object { "range": Array [ - 4, - 7, + 0, + 26, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "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, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 19, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 19, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, - 18, + 27, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "interface", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -38278,15 +48436,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "f1": Object { + "d": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -38294,9 +48452,9 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f1", + "name": "d", "range": Array [ - 9, + 10, 11, ], "type": "Identifier", @@ -38304,29 +48462,29 @@ Object { "node": Object { "range": Array [ 0, - 18, + 27, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f1", + "name": "d", "range": Array [ - 9, + 10, 11, ], "type": "Identifier", }, ], - "name": "f1", + "name": "d", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -38340,19 +48498,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-arrow-function.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 19, + 51, ], "type": "Program", }, @@ -38362,62 +48520,72 @@ Object { "block": Object { "range": Array [ 0, - 19, + 51, ], - "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, + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", }, - "variables": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { + "from": Object { "$ref": 2, }, + "identifier": Object { + "name": "baz", + "range": Array [ + 26, + 37, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, }, ], + "type": "interface", + "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", "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "f1": Object { + "Foo": Object { "$ref": 0, }, }, @@ -38430,36 +48598,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f1", + "name": "Foo", "range": Array [ - 9, - 11, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 18, + 49, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f1", + "name": "Foo", "range": Array [ - 9, - 11, + 10, + 13, ], "type": "Identifier", }, ], - "name": "f1", + "name": "Foo", "references": Array [], "scope": Object { "$ref": 3, @@ -38471,7 +48639,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -38482,153 +48654,93 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-constructor.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, - 35, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 35, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 34, + 50, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 3, - "block": Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "baz", "range": Array [ - 25, - 32, + 27, + 38, ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { + "throughReferences": Array [ + Object { "$ref": 1, }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 4, }, "variableMap": Object { - "foo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [ Object { @@ -38636,39 +48748,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 34, + 50, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "ClassName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 10, + 13, ], "type": "Identifier", }, ], - "name": "foo", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 3, }, }, ], @@ -38677,120 +48789,108 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-function-expression.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, - 28, + 54, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 28, + 54, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ - 12, - 27, + 0, + 52, ], - "type": "FunctionExpression", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 29, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 27, - ], - "type": "FunctionExpression", - }, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { - "foo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -38798,49 +48898,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 10, + 13, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 27, + 52, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 10, + 13, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -38849,164 +48939,108 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, - 28, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 28, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 27, + 49, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 3, - "block": Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "baz", "range": Array [ - 18, - 25, + 26, + 37, ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ + "throughReferences": Array [ Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, + "$ref": 1, }, ], + "type": "interface", + "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", "upperScope": Object { - "$ref": 6, + "$ref": 4, }, "variableMap": Object { - "foo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [ Object { @@ -39014,39 +49048,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 27, + 49, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "ClassName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 10, + 13, ], "type": "Identifier", }, ], - "name": "foo", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 3, }, }, ], @@ -39055,109 +49089,85 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 1, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 72, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 72, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ - 7, - 72, + 0, + 49, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "enum", + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 26, + 37, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -39165,18 +49175,22 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { - "X": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -39184,39 +49198,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "Foo", "range": Array [ - 68, - 69, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 72, + 0, + 49, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "Foo", "range": Array [ - 68, - 69, + 10, + 13, ], "type": "Identifier", }, ], - "name": "X", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -39225,220 +49239,24 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 1, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -39448,7 +49266,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39456,189 +49274,439 @@ 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", + "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", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", + "$ref": 4, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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", "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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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", "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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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", "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 +49716,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39656,220 +49724,716 @@ 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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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", "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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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", "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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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", "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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 5, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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", "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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -39880,46 +50444,116 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -39930,46 +50564,116 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -39980,46 +50684,116 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -40030,46 +50804,116 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -40080,46 +50924,116 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -40130,94 +51044,224 @@ 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": 4, "block": Object { "range": Array [ 0, - 41, + 44, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 41, + 44, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 43, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "fff", + "range": Array [ + 19, + 31, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, + 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": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "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", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, "variables": Array [], }, @@ -40225,49 +51269,81 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", "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", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, "variables": Array [], }, @@ -40275,26 +51351,28 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", "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 +51382,7 @@ Object { "block": Object { "range": Array [ 0, - 44, + 5, ], "type": "Program", }, @@ -40338,23 +51416,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 +51443,73 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -40409,34 +51521,40 @@ Object { Object { "$ref": 0, }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, ], "type": "global", "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 +51563,137 @@ 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", "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 +51701,116 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "global", "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, "variables": Array [], }, @@ -40541,24 +51818,34 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "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 +51855,7 @@ Object { "block": Object { "range": Array [ 0, - 24, + 14, ], "type": "Program", }, @@ -40599,10 +51886,10 @@ Object { "$ref": 2, }, "identifier": Object { - "name": "foo", + "name": "bar", "range": Array [ - 10, - 13, + 4, + 7, ], "type": "Identifier", }, @@ -40651,89 +51938,338 @@ 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", + "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", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` +Object { + "$id": 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", + }, + "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", + "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", + "upperScope": Object { + "$ref": 6, }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, + "variableMap": Object { + "select": Object { + "$ref": 1, + }, }, - "identifier": Object { - "name": "A", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", + "variableScope": Object { + "$ref": 6, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "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", "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 +52277,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 +52320,99 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", "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", "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", + "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", "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], }, @@ -40967,67 +52420,317 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "throughReferences": Array [], "type": "global", "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", + "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", + "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", + "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", "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 +52738,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, }, }, ], @@ -41085,11 +52822,11 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [], }, @@ -41102,168 +52839,462 @@ 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", + "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", "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", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "Id": Object { + "$ref": 11, + }, + }, + "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, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "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", + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "B": Object { + "$ref": 3, + }, + "Point": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Point", + "range": Array [ + 62, + 67, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 56, + 135, + ], + "type": "ClassDeclaration", }, + "parent": null, + "type": "ClassName", }, ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Point", + "range": Array [ + 62, + 67, + ], + "type": "Identifier", + }, + ], + "name": "Point", + "references": Array [], + "scope": Object { + "$ref": 14, + }, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "select": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "select", + "name": "B", "range": Array [ - 41, - 47, + 154, + 155, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 82, + 147, + 229, ], - "type": "TSDeclareFunction", + "type": "TSModuleDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "NamespaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "select", + "name": "B", "range": Array [ - 41, - 47, + 154, + 155, ], "type": "Identifier", }, ], - "name": "select", + "name": "B", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 14, }, }, ], @@ -41275,15 +53306,18 @@ Object { "throughReferences": Array [], "type": "module", "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 +53325,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 +53346,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, }, }, ], @@ -41337,29 +53421,29 @@ 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", }, @@ -41370,61 +53454,234 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 0, }, "variables": Array [], }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/array-type.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ Object { "$id": 2, "block": Object { "range": Array [ - 43, - 51, + 0, + 20, ], - "type": "TSModuleBlock", + "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", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$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, + 19, + ], + "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", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/conditional.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ - 81, - 89, + 0, + 49, ], - "type": "TSModuleBlock", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 1, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -41433,366 +53690,187 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "global": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, - "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, - }, - }, - ], + "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` +exports[`typescript fixtures/types/conditional-infer.src 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, - 114, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, - 114, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, - "block": Object { - "range": Array [ - 13, - 112, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 34, - 73, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 58, - 66, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, + "$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", + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "type-alias", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { - "C": Object { - "$ref": 0, - }, - "bar": Object { + "T": Object { "$ref": 1, }, }, "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 +53879,408 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 8, + }, + "variableMap": Object { + "Element": Object { + "$ref": 0, + }, }, - "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", "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, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "variableMap": Object { - "Point": Object { - "$ref": 5, - }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 13, }, - "variableScope": Object { + "identifier": Object { + "name": "U", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "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": "U", + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 11, - "block": Object { + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 156, - 229, + 83, + 84, ], - "type": "TSModuleBlock", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 12, + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "variableMap": Object {}, - "variableScope": Object { + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { "$ref": 13, }, - "variables": Array [], + "identifier": Object { + "name": "Promise", + "range": Array [ + 93, + 100, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 4, + "$id": 10, "from": Object { - "$ref": 12, + "$ref": 13, }, "identifier": Object { - "name": "x", + "name": "U", "range": Array [ - 27, - 28, + 107, + 108, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 1, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 13, }, - "writeExpr": Object { + "identifier": Object { + "name": "U", "range": Array [ - 31, - 44, + 112, + 113, ], - "type": "Literal", + "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, }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, ], - "type": "block", + "type": "type-alias", "upperScope": Object { - "$ref": 13, + "$ref": 14, }, "variableMap": Object { - "B": Object { - "$ref": 3, - }, - "Point": Object { - "$ref": 2, + "T": Object { + "$ref": 1, }, }, "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 +54289,40 @@ 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, + "$ref": 15, }, "variableMap": Object { - "A": Object { + "Unpacked": Object { "$ref": 0, }, - "x": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 13, + "$ref": 14, }, "variables": Array [ Object { @@ -42237,89 +54330,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 +54371,240 @@ 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", "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", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "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, + "$ref": 8, }, "variableMap": Object { - "x": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [ Object { @@ -42482,45 +54612,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 +54653,22 @@ 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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } @@ -42793,7 +54777,7 @@ Object { exports[`typescript fixtures/types/constructor.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -42803,7 +54787,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -42814,11 +54798,53 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "f": Object { @@ -42826,7 +54852,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -42872,7 +54898,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -42881,12 +54907,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -42894,7 +54927,7 @@ Object { exports[`typescript fixtures/types/constructor-generic.src 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, @@ -42904,7 +54937,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -42915,19 +54948,82 @@ 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 [ + 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, + }, + ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { + "T": Object { + "$ref": 1, + }, "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -42973,7 +55069,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 +55125,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } @@ -42995,7 +55142,7 @@ Object { exports[`typescript fixtures/types/constructor-in-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43005,7 +55152,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43015,12 +55162,34 @@ Object { }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -43028,7 +55197,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43074,7 +55243,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43083,12 +55252,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43096,7 +55269,7 @@ Object { exports[`typescript fixtures/types/constructor-with-rest.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43106,7 +55279,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43117,11 +55290,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -43129,7 +55324,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43175,7 +55370,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43184,12 +55379,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43197,7 +55396,7 @@ Object { exports[`typescript fixtures/types/function.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43207,7 +55406,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43218,11 +55417,53 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "f": Object { @@ -43230,7 +55471,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -43276,7 +55517,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -43285,12 +55526,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -43298,7 +55546,7 @@ Object { exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, @@ -43308,7 +55556,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -43319,19 +55567,82 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { + "T": Object { + "$ref": 1, + }, "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -43377,7 +55688,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 +55744,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } @@ -43399,7 +55761,7 @@ Object { exports[`typescript fixtures/types/function-in-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43409,7 +55771,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43420,11 +55782,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -43432,7 +55816,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43478,7 +55862,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43487,12 +55871,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43500,7 +55888,7 @@ Object { exports[`typescript fixtures/types/function-with-array-destruction.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43510,7 +55898,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43518,31 +55906,131 @@ 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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -43550,7 +56038,7 @@ Object { exports[`typescript fixtures/types/function-with-object-destruction.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43560,7 +56048,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43568,31 +56056,131 @@ 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", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -43600,7 +56188,7 @@ Object { exports[`typescript fixtures/types/function-with-rest.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43610,7 +56198,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43621,11 +56209,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -43633,7 +56243,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43679,7 +56289,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43688,12 +56298,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43701,7 +56315,7 @@ Object { exports[`typescript fixtures/types/function-with-this.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43711,7 +56325,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43722,11 +56336,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -43734,7 +56370,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -43780,7 +56416,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -43789,12 +56425,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43802,7 +56442,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43812,7 +56452,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43820,31 +56460,131 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 16, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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, + 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": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -43852,7 +56592,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43862,7 +56602,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43870,31 +56610,131 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "key", + "range": Array [ + 25, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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, + 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": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -43902,7 +56742,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43912,7 +56752,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43920,31 +56760,131 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 16, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "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", "upperScope": Object { - "$ref": 1, + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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, + 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": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -43952,7 +56892,7 @@ Object { exports[`typescript fixtures/types/indexed.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -43962,7 +56902,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43973,11 +56913,53 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -43985,7 +56967,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -44031,7 +57013,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -44040,12 +57022,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -44053,7 +57042,7 @@ Object { exports[`typescript fixtures/types/intersection-type.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -44063,7 +57052,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -44071,20 +57060,208 @@ 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", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "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", "upperScope": Object { - "$ref": 1, + "$ref": 7, + }, + "variableMap": Object { + "LinkedList": Object { + "$ref": 0, + }, }, - "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, @@ -44095,7 +57272,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -44406,7 +57583,7 @@ Object { exports[`typescript fixtures/types/mapped.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44416,7 +57593,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44427,11 +57604,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44439,7 +57638,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44485,7 +57684,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44494,12 +57693,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44507,7 +57710,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44517,7 +57720,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44528,11 +57731,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44540,7 +57765,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44586,7 +57811,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44595,12 +57820,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44608,7 +57837,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly-minus.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44618,7 +57847,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44629,11 +57858,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44641,7 +57892,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44687,7 +57938,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44696,12 +57947,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44709,7 +57964,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly-plus.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44719,7 +57974,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44730,11 +57985,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44742,7 +58019,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44788,7 +58065,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44797,12 +58074,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44810,7 +58091,7 @@ Object { exports[`typescript fixtures/types/mapped-untypped.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44820,7 +58101,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44831,11 +58112,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -44843,7 +58146,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -44889,7 +58192,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -44898,12 +58201,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44911,7 +58218,7 @@ Object { exports[`typescript fixtures/types/nested-types.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44921,7 +58228,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44929,20 +58236,90 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -44953,7 +58330,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -44961,7 +58338,7 @@ Object { exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44971,7 +58348,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44979,20 +58356,90 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -45003,7 +58450,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -45011,7 +58458,7 @@ Object { exports[`typescript fixtures/types/reference.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45021,7 +58468,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45032,11 +58479,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -45044,7 +58513,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -45090,7 +58559,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -45099,12 +58568,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45112,7 +58585,7 @@ Object { exports[`typescript fixtures/types/reference-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45122,7 +58595,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45133,11 +58606,33 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -45145,7 +58640,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -45191,7 +58686,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -45200,12 +58695,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45213,7 +58712,7 @@ Object { exports[`typescript fixtures/types/reference-generic-nested.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -45223,7 +58722,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45234,11 +58733,53 @@ 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", "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -45246,7 +58787,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -45292,7 +58833,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -45301,12 +58842,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -45520,7 +59068,7 @@ Object { exports[`typescript fixtures/types/this-type-expanded.src 1`] = ` Object { - "$id": 24, + "$id": 28, "block": Object { "range": Array [ 0, @@ -45530,7 +59078,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 23, + "$id": 27, "block": Object { "range": Array [ 0, @@ -45540,7 +59088,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 22, + "$id": 26, "block": Object { "range": Array [ 0, @@ -45565,7 +59113,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { @@ -45590,7 +59138,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 109, @@ -45601,11 +59149,35 @@ 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", "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { @@ -45613,7 +59185,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -45624,13 +59196,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], }, Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 167, @@ -45640,7 +59212,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 203, @@ -45655,11 +59227,11 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], }, @@ -45668,9 +59240,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "fn", @@ -45682,7 +59254,7 @@ Object { }, "kind": "w", "resolved": Object { - "$ref": 7, + "$ref": 8, }, "writeExpr": Object { "range": Array [ @@ -45693,9 +59265,9 @@ Object { }, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "fn", @@ -45707,7 +59279,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 7, + "$ref": 8, }, "writeExpr": undefined, }, @@ -45715,33 +59287,33 @@ Object { "throughReferences": Array [], "type": "function", "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 +59355,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 +59378,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 18, "block": Object { "range": Array [ 288, @@ -45821,11 +59393,11 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 17, + "$ref": 19, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 18, }, "variables": Array [], }, @@ -45834,9 +59406,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 +59439,7 @@ Object { }, "kind": "w", "resolved": Object { - "$ref": 13, + "$ref": 14, }, "writeExpr": Object { "range": Array [ @@ -45859,9 +59450,9 @@ Object { }, }, Object { - "$id": 15, + "$id": 17, "from": Object { - "$ref": 17, + "$ref": 19, }, "identifier": Object { "name": "fn", @@ -45873,41 +59464,45 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 13, + "$ref": 14, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 15, + }, + ], "type": "function", "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 +59544,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 +59568,60 @@ 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", "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 +59632,54 @@ 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", "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, }, }, ], @@ -46048,7 +59691,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 23, + "$ref": 27, }, "variableMap": Object { "A": Object { @@ -46056,7 +59699,7 @@ Object { }, }, "variableScope": Object { - "$ref": 23, + "$ref": 27, }, "variables": Array [ Object { @@ -46094,9 +59737,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, }, }, ], @@ -46108,7 +59764,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 24, + "$ref": 28, }, "variableMap": Object { "A": Object { @@ -46116,7 +59772,7 @@ Object { }, }, "variableScope": Object { - "$ref": 23, + "$ref": 27, }, "variables": Array [ Object { @@ -46156,7 +59812,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 23, + "$ref": 27, }, }, ], @@ -46170,7 +59826,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 24, + "$ref": 28, }, "variables": Array [], } @@ -46323,21 +59979,122 @@ Object { "name": "x", "range": Array [ 4, - 9, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 10, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 9, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/tuple-optional.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 9, + 44, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 10, + 44, ], "type": "VariableDeclaration", }, @@ -46350,7 +60107,7 @@ Object { "name": "x", "range": Array [ 4, - 9, + 44, ], "type": "Identifier", }, @@ -46378,13 +60135,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 +60151,7 @@ Object { "block": Object { "range": Array [ 0, - 45, + 29, ], "type": "Program", }, @@ -46424,21 +60181,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 +60208,7 @@ Object { "name": "x", "range": Array [ 4, - 44, + 28, ], "type": "Identifier", }, @@ -46479,9 +60236,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 +60248,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -46499,22 +60256,47 @@ 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", + "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, + "$ref": 3, }, "variableMap": Object { - "x": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -46522,45 +60304,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, }, }, ], @@ -46574,57 +60350,7 @@ 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 [], } @@ -46733,7 +60459,7 @@ Object { exports[`typescript fixtures/types/type-operator.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -46743,7 +60469,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -46754,11 +60480,33 @@ 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", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -46769,7 +60517,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -46815,7 +60563,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, Object { @@ -46861,7 +60609,7 @@ Object { "name": "y", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -46870,12 +60618,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -47258,7 +61010,7 @@ Object { exports[`typescript fixtures/types/union-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -47268,7 +61020,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -47276,20 +61028,90 @@ 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", + "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": 1, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -47300,7 +61122,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } From 3067b9ed1a8e79321e6beeba1c740bd3423b5a0c Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 12 Feb 2019 22:34:46 +0100 Subject: [PATCH 02/12] feat(parser): fix index signature and add invalid test --- .../tests/eslint-rules/no-undef.test.ts | 37 +- packages/parser/src/analyze-scope.ts | 18 +- .../lib/__snapshots__/typescript.ts.snap | 692 +++++------------- 3 files changed, 222 insertions(+), 525 deletions(-) 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..bbc48e84a195 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -3,7 +3,7 @@ import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parserOptions: { - ecmaVersion: 6, + ecmaVersion: 10, sourceType: 'module', ecmaFeatures: {}, }, @@ -60,7 +60,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 +85,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 +132,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/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index c6bbd2956dd3..4d13d42058c0 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -527,7 +527,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; } /** diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index 5b61888a0183..65fe153afbb5 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -23268,7 +23268,7 @@ Object { exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 22, + "$id": 21, "block": Object { "range": Array [ 0, @@ -23278,7 +23278,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 21, + "$id": 20, "block": Object { "range": Array [ 0, @@ -23288,7 +23288,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 20, + "$id": 19, "block": Object { "range": Array [ 0, @@ -23303,7 +23303,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "bax", @@ -23320,7 +23320,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "baz", @@ -23337,24 +23337,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 20, - }, - "identifier": Object { - "name": "eee", - "range": Array [ - 95, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -23369,9 +23352,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 6, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -23386,9 +23369,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 7, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -23403,9 +23386,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "loo", @@ -23420,9 +23403,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 9, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -23437,9 +23420,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 10, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -23454,9 +23437,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 11, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -23471,9 +23454,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 12, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -23488,9 +23471,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 13, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -23505,9 +23488,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 14, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -23522,9 +23505,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 16, + "$id": 15, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -23539,9 +23522,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 16, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -23556,9 +23539,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 18, + "$id": 17, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -23573,9 +23556,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 19, + "$id": 18, "from": Object { - "$ref": 20, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -23639,13 +23622,10 @@ Object { Object { "$ref": 18, }, - Object { - "$ref": 19, - }, ], "type": "interface", "upperScope": Object { - "$ref": 21, + "$ref": 20, }, "variableMap": Object { "F": Object { @@ -23656,7 +23636,7 @@ Object { }, }, "variableScope": Object { - "$ref": 21, + "$ref": 20, }, "variables": Array [ Object { @@ -23696,7 +23676,7 @@ Object { "name": "J", "references": Array [], "scope": Object { - "$ref": 20, + "$ref": 19, }, }, Object { @@ -23736,7 +23716,7 @@ Object { "name": "F", "references": Array [], "scope": Object { - "$ref": 20, + "$ref": 19, }, }, ], @@ -23794,13 +23774,10 @@ Object { Object { "$ref": 18, }, - Object { - "$ref": 19, - }, ], "type": "module", "upperScope": Object { - "$ref": 22, + "$ref": 21, }, "variableMap": Object { "Foo": Object { @@ -23808,7 +23785,7 @@ Object { }, }, "variableScope": Object { - "$ref": 21, + "$ref": 20, }, "variables": Array [ Object { @@ -23848,7 +23825,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 20, }, }, ], @@ -23906,15 +23883,12 @@ Object { Object { "$ref": 18, }, - Object { - "$ref": 19, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 22, + "$ref": 21, }, "variables": Array [], } @@ -48090,7 +48064,7 @@ Object { exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48100,7 +48074,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48110,7 +48084,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48121,57 +48095,15 @@ Object { "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": "b", - "range": Array [ - 27, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], }, @@ -48179,17 +48111,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 3, }, "variableMap": Object { "foo": Object { @@ -48197,7 +48122,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { @@ -48237,7 +48162,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -48246,19 +48171,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [], } @@ -48506,7 +48424,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48516,7 +48434,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48526,7 +48444,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48537,37 +48455,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 26, - 37, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -48575,14 +48471,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -48590,7 +48482,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -48630,7 +48522,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -48639,16 +48531,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -48656,7 +48544,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48666,7 +48554,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48676,7 +48564,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48687,37 +48575,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 27, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -48725,14 +48591,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -48740,7 +48602,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -48780,7 +48642,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -48789,16 +48651,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -48806,7 +48664,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48816,7 +48674,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48826,7 +48684,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48837,37 +48695,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 29, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -48875,14 +48711,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -48890,7 +48722,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -48930,7 +48762,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -48939,16 +48771,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -48956,7 +48784,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48966,7 +48794,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48976,7 +48804,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48987,37 +48815,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 26, - 37, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -49025,14 +48831,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -49040,7 +48842,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -49080,7 +48882,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -49089,16 +48891,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -49106,7 +48904,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49116,7 +48914,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49126,7 +48924,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49137,37 +48935,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 26, - 37, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -49175,14 +48951,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -49190,7 +48962,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -49230,7 +49002,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -49239,16 +49011,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -51054,7 +50822,7 @@ exports[`typescript fixtures/errorRecovery/interface-with-no-body.src 1`] = `"'{ exports[`typescript fixtures/errorRecovery/interface-with-optional-index-signature.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -51064,7 +50832,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -51074,7 +50842,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -51085,37 +50853,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "fff", - "range": Array [ - 19, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -51123,14 +50869,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -51138,7 +50880,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -51178,7 +50920,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -51187,16 +50929,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -56442,7 +56180,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -56452,7 +56190,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -56462,7 +56200,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -56473,37 +56211,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 16, - 25, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -56511,14 +56227,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "foo": Object { @@ -56526,7 +56238,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -56566,7 +56278,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -56575,16 +56287,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -56592,7 +56300,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -56602,7 +56310,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -56612,7 +56320,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -56623,37 +56331,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "key", - "range": Array [ - 25, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -56661,14 +56347,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "foo": Object { @@ -56676,7 +56358,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -56716,7 +56398,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -56725,16 +56407,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -56742,7 +56420,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -56752,7 +56430,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -56762,7 +56440,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -56773,37 +56451,15 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 16, - 25, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -56811,14 +56467,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "foo": Object { @@ -56826,7 +56478,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -56866,7 +56518,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -56875,16 +56527,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } From c5c100cd3be53d6dd58570f412cab4b98cdd8c4f Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 12 Feb 2019 22:40:59 +0100 Subject: [PATCH 03/12] feat(parser): remove redundant tests fixtures --- .../parameter-property-simple.ts | 8 - .../scope-analysis/parameter-property.ts | 8 - .../lib/__snapshots__/scope-analysis.ts.snap | 1032 ----------------- 3 files changed, 1048 deletions(-) delete mode 100644 packages/parser/tests/fixtures/scope-analysis/parameter-property-simple.ts delete mode 100644 packages/parser/tests/fixtures/scope-analysis/parameter-property.ts diff --git a/packages/parser/tests/fixtures/scope-analysis/parameter-property-simple.ts b/packages/parser/tests/fixtures/scope-analysis/parameter-property-simple.ts deleted file mode 100644 index 9292782b9538..000000000000 --- a/packages/parser/tests/fixtures/scope-analysis/parameter-property-simple.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { InjectRepository, Repository, User } from 'test'; - -export default class Foo { - constructor( - @InjectRepository(User) - userRepository: Repository, - ) {} -} diff --git a/packages/parser/tests/fixtures/scope-analysis/parameter-property.ts b/packages/parser/tests/fixtures/scope-analysis/parameter-property.ts deleted file mode 100644 index 12d5c722c9ec..000000000000 --- a/packages/parser/tests/fixtures/scope-analysis/parameter-property.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { InjectRepository, Repository, User } from 'test'; - -export default class Foo { - constructor( - @InjectRepository(User) - private readonly userRepository: Repository, - ) {} -} diff --git a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap index ccab06f413f5..076acb55c5d9 100644 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap @@ -10139,1034 +10139,6 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/parameter-property.ts 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 [ - 75, - 193, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 100, - 191, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 7, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "Repository", - "range": Array [ - 167, - 177, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "User", - "range": Array [ - 178, - 182, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "InjectRepository", - "range": Array [ - 107, - 123, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "User", - "range": Array [ - 124, - 128, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 5, - }, - "userRepository": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "userRepository", - "range": Array [ - 151, - 183, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 100, - 191, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "userRepository", - "range": Array [ - 151, - 183, - ], - "type": "Identifier", - }, - ], - "name": "userRepository", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 193, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 3, - }, - "InjectRepository": Object { - "$ref": 0, - }, - "Repository": Object { - "$ref": 1, - }, - "User": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "InjectRepository", - "range": Array [ - 9, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 25, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 58, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "InjectRepository", - "range": Array [ - 9, - 25, - ], - "type": "Identifier", - }, - ], - "name": "InjectRepository", - "references": Array [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Repository", - "range": Array [ - 27, - 37, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 37, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 58, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Repository", - "range": Array [ - 27, - 37, - ], - "type": "Identifier", - }, - ], - "name": "Repository", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "User", - "range": Array [ - 39, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 39, - 43, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 58, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "User", - "range": Array [ - 39, - 43, - ], - "type": "Identifier", - }, - ], - "name": "User", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 193, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 13, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/parameter-property-simple.ts 1`] = ` -Object { - "$id": 14, - "block": Object { - "range": Array [ - 0, - 177, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 13, - "block": Object { - "range": Array [ - 0, - 177, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 12, - "block": Object { - "range": Array [ - 75, - 176, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 11, - "block": Object { - "range": Array [ - 100, - 174, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 7, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "InjectRepository", - "range": Array [ - 107, - 123, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "User", - "range": Array [ - 124, - 128, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "Repository", - "range": Array [ - 150, - 160, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "User", - "range": Array [ - 161, - 165, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 5, - }, - "userRepository": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 5, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "userRepository", - "range": Array [ - 134, - 166, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 100, - 174, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "userRepository", - "range": Array [ - 134, - 166, - ], - "type": "Identifier", - }, - ], - "name": "userRepository", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 176, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 3, - }, - "InjectRepository": Object { - "$ref": 0, - }, - "Repository": Object { - "$ref": 1, - }, - "User": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 13, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "InjectRepository", - "range": Array [ - 9, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 9, - 25, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 58, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "InjectRepository", - "range": Array [ - 9, - 25, - ], - "type": "Identifier", - }, - ], - "name": "InjectRepository", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Repository", - "range": Array [ - 27, - 37, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 37, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 58, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Repository", - "range": Array [ - 27, - 37, - ], - "type": "Identifier", - }, - ], - "name": "Repository", - "references": Array [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "User", - "range": Array [ - 39, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 39, - 43, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 0, - 58, - ], - "type": "ImportDeclaration", - }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "User", - "range": Array [ - 39, - 43, - ], - "type": "Identifier", - }, - ], - "name": "User", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 176, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 81, - 84, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 13, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [], -} -`; - exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/rest-element.ts 1`] = ` Object { "$id": 5, @@ -27414,10 +26386,6 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/parameter-property.ts 1`] = `"ImportDeclaration should appear when the mode is ES6 and in the module context."`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/parameter-property-simple.ts 1`] = `"ImportDeclaration should appear when the mode is ES6 and in the module context."`; - exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/rest-element.ts 1`] = ` Object { "$id": 4, From cf1f888a111ff04dbca548f5dd6e6de8a0745776 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 12 Feb 2019 22:55:13 +0100 Subject: [PATCH 04/12] feat(parser): allow to setup env in RuleTester --- .../eslint-plugin/tests/eslint-rules/no-undef.test.ts | 10 +++++++--- .../experimental-utils/src/ts-eslint/RuleTester.ts | 11 ++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) 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 bbc48e84a195..7c3002fad6b3 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -5,8 +5,8 @@ const ruleTester = new RuleTester({ parserOptions: { 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 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, From 8271872336312eb22c3cc523c53644ed17f5ad6b Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 01:42:23 +0100 Subject: [PATCH 05/12] fix(parser): split variables from types --- .../tests/eslint-rules/no-undef.test.ts | 2 +- .../src/ts-eslint-scope/Referencer.ts | 10 +- .../src/ts-eslint-scope/ScopeManager.ts | 42 +- packages/parser/src/analyze-scope.ts | 123 +- packages/parser/src/scope/pattern-visitor.ts | 84 + packages/parser/src/scope/scope-manager.ts | 87 +- packages/parser/src/scope/scopes.ts | 168 +- .../lib/__snapshots__/scope-analysis.ts.snap | 6048 +++----- .../tests/lib/__snapshots__/tsx.ts.snap | 115 +- .../lib/__snapshots__/typescript.ts.snap | 11586 ++++------------ 10 files changed, 4730 insertions(+), 13535 deletions(-) create mode 100644 packages/parser/src/scope/pattern-visitor.ts 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 7c3002fad6b3..9607e2363458 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -40,7 +40,7 @@ class X { /*globals document, selector */ const links = document.querySelectorAll( selector ) as NodeListOf `, - env: { browser: true } + env: { browser: true }, }, // https://github.com/eslint/typescript-eslint-parser/issues/437 ` diff --git a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts b/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts index 69e20949467d..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; @@ -80,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/ScopeManager.ts b/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts index 58728146e5c9..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/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 4d13d42058c0..987656363bb7 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -10,112 +10,10 @@ 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); - } - - 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); - } - } -} - -class Referencer extends TSESLintScope.Referencer { +class Referencer extends TSESLintScope.Referencer { protected typeMode: boolean; constructor( @@ -494,7 +392,7 @@ class Referencer extends TSESLintScope.Referencer { this.visit(node.typeParameters); if (node.id) { - scope.__define( + scope.__defineType( node.id, new TypeDefinition('InterfaceName', node.id, node, null, null, null), ); @@ -537,7 +435,7 @@ class Referencer extends TSESLintScope.Referencer { this.visitPattern( node.parameters[i], { processRightHandNodes: true }, - () => {} + () => {}, ); } @@ -599,7 +497,7 @@ class Referencer extends TSESLintScope.Referencer { node.params[i], { processRightHandNodes: true }, (pattern, info) => { - this.currentScope().__define( + this.currentScope().__defineType( pattern, new TypeDefinition('TypeParameter', pattern, node, null, i), ); @@ -852,7 +750,7 @@ class Referencer extends TSESLintScope.Referencer { this.typeMode = true; if (node.id && node.id.type === AST_NODE_TYPES.Identifier) { - scope.__define( + scope.__defineType( node.id, new TSESLintScope.Definition( 'TypeAliasName', @@ -929,11 +827,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) { @@ -941,7 +835,6 @@ class Referencer extends TSESLintScope.Referencer { } scopeManager.__currentScope = currentScope; - globalScope.__define = originalDefine; } /** 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 5c0f69c2964d..891b986ac63b 100644 --- a/packages/parser/src/scope/scope-manager.ts +++ b/packages/parser/src/scope/scope-manager.ts @@ -1,53 +1,112 @@ import { TSESTree, TSESLintScope } from '@typescript-eslint/experimental-utils'; 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, - ): TSESLintScope.Scope { + __nestInterfaceScope(node: TSESTree.TSInterfaceDeclaration): Scope { return this.__nestScope( new InterfaceScope(this, this.__currentScope, node), ); } /** @internal */ - __nestTypeAliasScope( - node: TSESTree.TSTypeAliasDeclaration, - ): TSESLintScope.Scope { + __nestTypeAliasScope(node: TSESTree.TSTypeAliasDeclaration): Scope { return this.__nestScope( new TypeAliasScope(this, this.__currentScope, node), ); } - // TODO: override __nest**Scope methods with new scope classes + /// 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 3ccdd576c511..d8f29c695f87 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -1,29 +1,24 @@ -import { TSESTree, TSESLintScope } from '@typescript-eslint/experimental-utils'; +import { + TSESTree, + TSESLintScope, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; import { ScopeManager } from './scope-manager'; export class Scope extends TSESLintScope.Scope { - /** @internal */ - __resolve(ref: TSESLintScope.Reference): boolean { - const name = ref.identifier.name; + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; - if (!this.set.has(name)) { - return false; - } - const variable = this.set.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); + /** @internal */ + __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.types, node, def); } - ref.resolved = variable; + } - return true; + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + return super.__resolve(ref); } } @@ -31,7 +26,7 @@ export class Scope 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); @@ -42,7 +37,7 @@ export class EnumScope extends 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); @@ -52,7 +47,7 @@ export class EmptyFunctionScope extends Scope { export class InterfaceScope extends Scope { constructor( scopeManager: ScopeManager, - upperScope: TSESLintScope.Scope, + upperScope: Scope, block: TSESTree.TSInterfaceDeclaration | null, ) { super(scopeManager, 'interface', upperScope, block, false); @@ -62,11 +57,134 @@ export class InterfaceScope extends Scope { export class TypeAliasScope extends Scope { constructor( scopeManager: ScopeManager, - upperScope: TSESLintScope.Scope, + upperScope: Scope, block: TSESTree.TSTypeAliasDeclaration | null, ) { super(scopeManager, 'type-alias', upperScope, block, false); } } -// TODO: extend all Scopes +/// eslint scopes + +export class GlobalScope extends TSESLintScope.GlobalScope { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + + /** @internal */ + __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + } + } + + __define( + node: TSESTree.Identifier, + definition: TSESLintScope.Definition, + ): void { + 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 { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + + /** @internal */ + __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + } + } +} + +export class WithScope extends TSESLintScope.WithScope { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + + /** @internal */ + __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + } + } +} + +export class FunctionScope extends TSESLintScope.FunctionScope { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + + /** @internal */ + __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + } + } +} + +// eslint simple scopes + +export class ModuleScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'module', upperScope, block, false); + } +} + +export class CatchScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'catch', upperScope, block, false); + } +} + +export class BlockScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'block', upperScope, block, false); + } +} + +export class SwitchScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'switch', upperScope, block, false); + } +} + +export class ForScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'for', upperScope, block, false); + } +} + +export class ClassScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.Node | null, + ) { + super(scopeManager, 'class', upperScope, block, false); + } +} diff --git a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap index 076acb55c5d9..2cc063c09a13 100644 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap @@ -370,7 +370,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-implements.ts 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -380,7 +380,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -390,7 +390,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -405,19 +405,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Foo": Object { - "$ref": 6, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { - "$id": 6, + "$id": 5, "defs": Array [ Object { "name": Object { @@ -453,7 +453,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -463,9 +463,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Component", @@ -480,9 +480,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Nullable", @@ -493,15 +493,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "SomeOther", @@ -516,9 +514,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Component2", @@ -534,78 +532,34 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 5, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "Nullable": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { "$id": 0, - "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": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -641,7 +595,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -651,21 +605,24 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 5, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], } @@ -1524,7 +1481,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-with-type-extends-default.ts 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1534,7 +1491,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -1544,7 +1501,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 7, @@ -1559,19 +1516,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "Bar": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -1607,7 +1564,7 @@ Object { "name": "Bar", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -1617,9 +1574,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Foo", @@ -1636,67 +1593,24 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { "Bar": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { "$id": 0, - "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": 5, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -1732,7 +1646,7 @@ Object { "name": "Bar", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -1743,14 +1657,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [], } @@ -1758,7 +1672,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` Object { - "$id": 13, + "$id": 12, "block": Object { "range": Array [ 0, @@ -1768,7 +1682,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 0, @@ -1778,7 +1692,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 10, "block": Object { "range": Array [ 35, @@ -1791,9 +1705,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s1", @@ -1810,9 +1724,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 7, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s2", @@ -1829,9 +1743,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s1", @@ -1848,9 +1762,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s2", @@ -1868,6 +1782,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 6, + }, Object { "$ref": 7, }, @@ -1877,17 +1794,14 @@ Object { Object { "$ref": 9, }, - Object { - "$ref": 10, - }, ], "type": "interface", "upperScope": Object { - "$ref": 12, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [], }, @@ -1896,9 +1810,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -1921,9 +1835,9 @@ Object { }, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "Symbol", @@ -1938,9 +1852,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -1963,9 +1877,9 @@ Object { }, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "Symbol", @@ -1982,20 +1896,17 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "module", "upperScope": Object { - "$ref": 13, + "$ref": 12, }, "variableMap": Object { - "A": Object { - "$ref": 2, - }, "s1": Object { "$ref": 0, }, @@ -2004,7 +1915,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [ Object { @@ -2050,17 +1961,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 3, + "$ref": 2, }, Object { - "$ref": 7, + "$ref": 6, }, Object { - "$ref": 9, + "$ref": 8, }, ], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, Object { @@ -2106,57 +2017,17 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 5, + "$ref": 4, }, Object { - "$ref": 8, + "$ref": 7, }, Object { - "$ref": 10, + "$ref": 9, }, ], "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, + "$ref": 11, }, }, ], @@ -2167,17 +2038,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 12, }, "variables": Array [], } @@ -2185,7 +2056,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` Object { - "$id": 13, + "$id": 12, "block": Object { "range": Array [ 0, @@ -2195,7 +2066,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 0, @@ -2205,7 +2076,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 10, "block": Object { "range": Array [ 35, @@ -2218,9 +2089,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s1", @@ -2237,9 +2108,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 7, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s2", @@ -2256,9 +2127,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s1", @@ -2275,9 +2146,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s2", @@ -2295,6 +2166,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 6, + }, Object { "$ref": 7, }, @@ -2304,17 +2178,14 @@ Object { Object { "$ref": 9, }, - Object { - "$ref": 10, - }, ], "type": "type-alias", "upperScope": Object { - "$ref": 12, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [], }, @@ -2323,9 +2194,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -2348,9 +2219,9 @@ Object { }, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "Symbol", @@ -2365,9 +2236,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -2390,9 +2261,9 @@ Object { }, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "Symbol", @@ -2409,20 +2280,17 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "module", "upperScope": Object { - "$ref": 13, + "$ref": 12, }, "variableMap": Object { - "A": Object { - "$ref": 2, - }, "s1": Object { "$ref": 0, }, @@ -2431,7 +2299,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [ Object { @@ -2477,17 +2345,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 3, + "$ref": 2, }, Object { - "$ref": 7, + "$ref": 6, }, Object { - "$ref": 9, + "$ref": 8, }, ], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, Object { @@ -2533,57 +2401,17 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 5, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, + "$ref": 4, }, - ], - "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", + "$ref": 7, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "A", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", + "$ref": 9, }, ], - "name": "A", - "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, ], @@ -2594,17 +2422,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 12, }, "variables": Array [], } @@ -2801,7 +2629,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, @@ -2811,7 +2639,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, @@ -2821,7 +2649,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -2834,9 +2662,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Map", @@ -2851,9 +2679,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Key", @@ -2864,15 +2692,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Value", @@ -2883,15 +2709,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "subject", @@ -2903,33 +2727,33 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 1, }, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, ], "type": "empty-function", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { - "Key": Object { - "$ref": 1, - }, - "Value": Object { - "$ref": 2, - }, "subject": Object { - "$ref": 3, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -2937,160 +2761,78 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Key", + "name": "subject", "range": Array [ - 15, - 18, + 27, + 51, ], "type": "Identifier", }, "node": Object { "range": Array [ - 14, - 26, + 0, + 69, ], - "type": "TSTypeParameterDeclaration", + "type": "TSDeclareFunction", }, "parent": null, - "type": "TypeParameter", + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Key", + "name": "subject", "range": Array [ - 15, - 18, + 27, + 51, ], "type": "Identifier", }, ], - "name": "Key", + "name": "subject", "references": Array [ Object { "$ref": 5, }, ], "scope": Object { - "$ref": 8, + "$ref": 6, }, }, - 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": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "eachr": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "eachr": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { "name": Object { "name": "eachr", @@ -3125,7 +2867,7 @@ Object { "name": "eachr", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -3135,6 +2877,12 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, @@ -3143,7 +2891,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } @@ -5522,7 +5270,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/empty-body-function.ts 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5532,7 +5280,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5542,7 +5290,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5555,9 +5303,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Map", @@ -5572,9 +5320,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Key", @@ -5585,15 +5333,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Value", @@ -5604,15 +5350,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "subject", @@ -5624,125 +5368,37 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 1, }, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, ], "type": "empty-function", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { - "Key": Object { - "$ref": 1, - }, - "Value": Object { - "$ref": 2, - }, "subject": Object { - "$ref": 3, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "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 { @@ -5778,11 +5434,11 @@ Object { "name": "subject", "references": Array [ Object { - "$ref": 7, + "$ref": 5, }, ], "scope": Object { - "$ref": 8, + "$ref": 6, }, }, ], @@ -5792,13 +5448,19 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object { "eachr": Object { @@ -5806,7 +5468,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -5846,7 +5508,7 @@ Object { "name": "eachr", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -5857,14 +5519,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, }, - ], + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } @@ -8056,7 +7724,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 14, + "$id": 11, "block": Object { "range": Array [ 0, @@ -8066,7 +7734,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 10, "block": Object { "range": Array [ 0, @@ -8076,7 +7744,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, @@ -8091,16 +7759,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 13, + "$ref": 10, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [], }, Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 16, @@ -8113,9 +7781,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 6, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 4, }, "identifier": Object { "name": "A", @@ -8126,29 +7794,27 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 6, + "$ref": 3, }, ], "type": "interface", "upperScope": Object { - "$ref": 13, + "$ref": 10, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [], }, Object { - "$id": 12, + "$id": 9, "block": Object { "range": Array [ 45, @@ -8161,9 +7827,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 5, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "B", @@ -8174,15 +7840,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 6, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "a", @@ -8194,14 +7858,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 0, }, "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 7, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -8212,15 +7876,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 8, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -8231,33 +7893,31 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 8, + "$ref": 5, }, Object { - "$ref": 9, + "$ref": 6, }, Object { - "$ref": 10, + "$ref": 7, }, Object { - "$ref": 11, + "$ref": 8, }, ], "type": "interface", "upperScope": Object { - "$ref": 13, + "$ref": 10, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [], }, @@ -8266,9 +7926,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 13, + "$ref": 10, }, "identifier": Object { "name": "C", @@ -8279,33 +7939,38 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 1, + }, + ], "type": "module", "upperScope": Object { - "$ref": 14, + "$ref": 11, }, "variableMap": Object { - "A": Object { - "$ref": 0, - }, - "B": Object { - "$ref": 1, - }, - "C": Object { - "$ref": 2, - }, "a": Object { - "$ref": 3, + "$ref": 0, }, }, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [ Object { @@ -8313,280 +7978,158 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "a", "range": Array [ - 5, - 6, + 110, + 114, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 15, + 110, + 114, ], - "type": "TSTypeAliasDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "TypeAliasName", + "parent": Object { + "range": Array [ + 106, + 114, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "a", "range": Array [ - 5, - 6, + 110, + 114, ], "type": "Identifier", }, ], - "name": "A", + "name": "a", "references": Array [ Object { "$ref": 6, }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, ], "scope": Object { - "$ref": 13, + "$ref": 10, }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "B", + "name": "foo", "range": Array [ - 26, - 27, + 7, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 16, - 44, + 0, + 27, ], - "type": "TSInterfaceDeclaration", + "type": "TSImportEqualsDeclaration", }, "parent": null, - "type": "InterfaceName", + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "foo", "range": Array [ - 26, - 27, + 7, + 10, ], "type": "Identifier", }, ], - "name": "B", - "references": Array [ - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$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 [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "TSImportEqualsDeclaration", - }, - "parent": null, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], + "name": "foo", + "references": Array [], "scope": Object { "$ref": 1, }, @@ -8660,7 +8203,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/interface-type.ts 1`] = ` Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, @@ -8670,7 +8213,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, @@ -8680,7 +8223,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, @@ -8695,16 +8238,16 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [], }, Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 27, @@ -8717,9 +8260,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 3, }, "identifier": Object { "name": "C", @@ -8730,24 +8273,22 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 2, }, ], "type": "interface", "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [], }, @@ -8756,9 +8297,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 0, "from": Object { - "$ref": 7, + "$ref": 4, }, "identifier": Object { "name": "C", @@ -8769,198 +8310,45 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, + "throughReferences": Array [ + Object { + "$ref": 0, }, - "R": Object { + Object { "$ref": 2, }, - "T": Object { - "$ref": 0, - }, + ], + "type": "module", + "upperScope": Object { + "$ref": 5, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, - "variables": Array [ - Object { - "$id": 0, - "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", - }, - 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 [ - 12, - 13, - ], - "type": "Identifier", - }, - Object { - "name": "T", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - ], - "name": "T", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "type": "TSInterfaceDeclaration", - }, - "parent": null, - "type": "InterfaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 2, - "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": 7, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, "variables": Array [], } @@ -10320,7 +9708,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -10330,7 +9718,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -10340,7 +9728,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -10355,11 +9743,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -10370,58 +9758,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -10432,7 +9775,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -10440,7 +9783,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` Object { - "$id": 13, + "$id": 12, "block": Object { "range": Array [ 0, @@ -10450,7 +9793,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 0, @@ -10460,7 +9803,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -10475,16 +9818,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 12, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [], }, Object { - "$id": 11, + "$id": 10, "block": Object { "range": Array [ 32, @@ -10494,7 +9837,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 9, "block": Object { "range": Array [ 47, @@ -10507,9 +9850,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -10520,15 +9863,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -10539,49 +9880,47 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 8, + "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, ], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 10, }, "variableMap": Object { "a": Object { - "$ref": 7, + "$ref": 6, }, "arguments": Object { - "$ref": 6, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 9, }, "variables": Array [ Object { - "$id": 6, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, Object { - "$id": 7, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -10617,7 +9956,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, ], @@ -10628,27 +9967,27 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 8, + "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, ], "type": "class", "upperScope": Object { - "$ref": 12, + "$ref": 11, }, "variableMap": Object { "C": Object { - "$ref": 5, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [ Object { - "$id": 5, + "$id": 4, "defs": Array [ Object { "name": Object { @@ -10684,7 +10023,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 10, }, }, ], @@ -10694,9 +10033,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "A", @@ -10707,84 +10046,39 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], "type": "module", "upperScope": Object { - "$ref": 13, + "$ref": 12, }, "variableMap": Object { - "A": Object { - "$ref": 0, - }, "C": Object { - "$ref": 2, + "$ref": 1, }, "a": Object { - "$ref": 1, + "$ref": 0, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [ Object { "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 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 [ - Object { - "$ref": 3, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -10826,11 +10120,11 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -10866,7 +10160,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, ], @@ -10875,12 +10169,22 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 12, }, "variables": Array [], } @@ -10888,7 +10192,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -10898,7 +10202,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -10908,7 +10212,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -10923,11 +10227,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], }, @@ -10936,9 +10240,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "a", @@ -10959,9 +10263,9 @@ Object { }, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "A", @@ -10972,15 +10276,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "b", @@ -10995,9 +10297,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "a", @@ -11018,9 +10320,9 @@ Object { }, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "b", @@ -11035,9 +10337,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "A", @@ -11048,16 +10350,20 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -11070,74 +10376,28 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, + "$ref": 8, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 16, - ], - "type": "TSTypeAliasDeclaration", - }, - "parent": null, - "type": "TypeAliasName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -11152,7 +10412,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], } @@ -11160,7 +10420,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -11170,7 +10430,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -11180,7 +10440,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -11195,18 +10455,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -11217,72 +10474,32 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, - Object { - "$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", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "T", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "T", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { "name": Object { "name": "f", @@ -11317,7 +10534,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -11331,7 +10548,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -11661,7 +10878,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof.ts 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -11671,7 +10888,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -11681,7 +10898,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 23, @@ -11694,9 +10911,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { "name": "obj", @@ -11715,16 +10932,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 2, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], }, @@ -11733,9 +10950,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "obj", @@ -11761,18 +10978,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { - "B": Object { - "$ref": 1, - }, "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -11818,54 +11032,14 @@ Object { "name": "obj", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - 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", + "$ref": 1, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "B", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", + "$ref": 2, }, ], - "name": "B", - "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -11879,7 +11053,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [], } @@ -12168,7 +11342,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` Object { - "$id": 18, + "$id": 16, "block": Object { "range": Array [ 0, @@ -12178,7 +11352,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 17, + "$id": 15, "block": Object { "range": Array [ 0, @@ -12188,7 +11362,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 14, "block": Object { "range": Array [ 25, @@ -12201,9 +11375,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -12220,9 +11394,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "a", @@ -12237,9 +11411,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -12256,9 +11430,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "b", @@ -12273,9 +11447,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 6, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "T", @@ -12286,15 +11460,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 7, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -12311,9 +11483,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 8, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -12330,9 +11502,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 9, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "a", @@ -12347,9 +11519,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 10, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -12366,9 +11538,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 11, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "b", @@ -12383,9 +11555,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 12, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "T", @@ -12396,15 +11568,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 13, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -12422,6 +11592,12 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, @@ -12434,6 +11610,9 @@ Object { Object { "$ref": 7, }, + Object { + "$ref": 8, + }, Object { "$ref": 9, }, @@ -12449,107 +11628,25 @@ Object { Object { "$ref": 13, }, - Object { - "$ref": 15, - }, ], "type": "interface", "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { - "T": Object { - "$ref": 3, - }, + "$ref": 15, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 17, + "$ref": 15, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 17, + "$ref": 15, }, "identifier": Object { "name": "obj", @@ -12573,33 +11670,36 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 3, + }, Object { "$ref": 5, }, Object { - "$ref": 7, + "$ref": 6, + }, + Object { + "$ref": 9, }, Object { "$ref": 11, }, Object { - "$ref": 13, + "$ref": 12, }, ], "type": "module", "upperScope": Object { - "$ref": 18, + "$ref": 16, }, "variableMap": Object { - "A": Object { - "$ref": 1, - }, "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 17, + "$ref": 15, }, "variables": Array [ Object { @@ -12644,6 +11744,9 @@ Object { ], "name": "obj", "references": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -12651,63 +11754,20 @@ Object { "$ref": 4, }, Object { - "$ref": 6, + "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { "$ref": 10, }, Object { - "$ref": 12, - }, - Object { - "$ref": 15, - }, - ], - "scope": Object { - "$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", + "$ref": 13, }, ], - "name": "A", - "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 15, }, }, ], @@ -12717,24 +11777,30 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 3, + }, Object { "$ref": 5, }, Object { - "$ref": 7, + "$ref": 6, + }, + Object { + "$ref": 9, }, Object { "$ref": 11, }, Object { - "$ref": 13, + "$ref": 12, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 18, + "$ref": 16, }, "variables": Array [], } @@ -12945,7 +12011,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -12955,7 +12021,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -12965,7 +12031,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12978,9 +12044,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "g", @@ -12992,14 +12058,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 2, }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -13010,30 +12076,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, "g": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -13044,55 +12109,11 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, 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 { @@ -13128,11 +12149,11 @@ Object { "name": "g", "references": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -13141,10 +12162,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "g": Object { @@ -13152,7 +12177,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -13192,7 +12217,7 @@ Object { "name": "g", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -13201,12 +12226,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } @@ -13645,7 +12674,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -13655,7 +12684,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -13665,7 +12694,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -13680,11 +12709,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -13695,58 +12724,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "variables": Array [ - Object { - "$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", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -13757,7 +12741,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -14117,7 +13101,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-infer.ts 1`] = ` Object { - "$id": 15, + "$id": 13, "block": Object { "range": Array [ 0, @@ -14127,7 +13111,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 12, "block": Object { "range": Array [ 0, @@ -14137,7 +13121,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 11, "block": Object { "range": Array [ 0, @@ -14150,9 +13134,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -14163,15 +13147,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -14186,9 +13168,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -14203,9 +13185,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -14216,15 +13198,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -14239,9 +13219,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -14256,9 +13236,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 6, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -14269,15 +13249,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 7, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "Promise", @@ -14292,9 +13270,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 8, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -14309,9 +13287,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 9, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -14326,9 +13304,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 10, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -14339,19 +13317,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, Object { "$ref": 4, }, + Object { + "$ref": 5, + }, Object { "$ref": 6, }, @@ -14359,94 +13347,48 @@ Object { "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { - "$ref": 10, + "$ref": 9, }, Object { - "$ref": 11, + "$ref": 10, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 12, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 12, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, Object { "$ref": 4, }, + Object { + "$ref": 5, + }, Object { "$ref": 6, }, @@ -14454,81 +13396,48 @@ Object { "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { - "$ref": 10, + "$ref": 9, }, Object { - "$ref": 11, + "$ref": 10, }, ], "type": "module", "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { - "Unpacked": Object { - "$ref": 0, - }, + "$ref": 13, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 12, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, Object { "$ref": 4, }, + Object { + "$ref": 5, + }, Object { "$ref": 6, }, @@ -14536,20 +13445,20 @@ Object { "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { - "$ref": 10, + "$ref": 9, }, Object { - "$ref": 11, + "$ref": 10, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 13, }, "variables": Array [], } @@ -14557,7 +13466,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -14567,7 +13476,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -14577,7 +13486,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14590,9 +13499,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -14603,15 +13512,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "LinkedList", @@ -14622,15 +13529,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -14641,153 +13546,76 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "LinkedList": Object { + "throughReferences": Array [ + Object { "$ref": 0, }, - }, - "variableScope": Object { - "$ref": 6, - }, - "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, - }, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], + "type": "module", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [], } @@ -15303,7 +14131,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15313,7 +14141,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -15323,7 +14151,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -15338,11 +14166,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -15353,58 +14181,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -15415,7 +14198,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -15423,7 +14206,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15433,7 +14216,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -15443,7 +14226,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -15458,11 +14241,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -15473,58 +14256,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -15535,7 +14273,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -16351,7 +15089,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16361,7 +15099,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -16371,7 +15109,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -16386,11 +15124,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -16401,58 +15139,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -16463,7 +15156,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -17123,7 +15816,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -17133,7 +15826,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -17143,7 +15836,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -17158,11 +15851,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -17173,58 +15866,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -17235,7 +15883,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -17398,7 +16046,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "foo", @@ -17538,7 +16186,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "A", @@ -17561,7 +16209,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-implements.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -17571,7 +16219,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -17586,19 +16234,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Foo": Object { - "$ref": 6, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { - "$id": 6, + "$id": 5, "defs": Array [ Object { "name": Object { @@ -17634,7 +16282,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -17644,9 +16292,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Component", @@ -17661,9 +16309,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Nullable", @@ -17674,15 +16322,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "SomeOther", @@ -17697,9 +16343,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Component2", @@ -17715,76 +16361,32 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 5, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "Nullable": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { "$id": 0, - "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": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -17806,7 +16408,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -17820,7 +16422,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -18048,7 +16650,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "s", @@ -18098,7 +16700,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "A", @@ -18504,7 +17106,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -18544,7 +17146,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo2", @@ -18584,7 +17186,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo3", @@ -18607,7 +17209,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-with-type-extends-default.ts 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -18617,7 +17219,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 7, @@ -18632,19 +17234,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "Bar": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -18680,7 +17282,7 @@ Object { "name": "Bar", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -18690,9 +17292,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Foo", @@ -18709,21 +17311,18 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object { "Bar": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -18731,47 +17330,7 @@ Object { "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": 5, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Bar", + "name": "Bar", "range": Array [ 13, 16, @@ -18789,7 +17348,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Bar", @@ -18803,7 +17362,7 @@ Object { "name": "Bar", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -18812,7 +17371,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 0, @@ -18822,7 +17381,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 10, "block": Object { "range": Array [ 35, @@ -18835,9 +17394,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 7, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s1", @@ -18854,9 +17413,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 7, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s2", @@ -18873,9 +17432,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s1", @@ -18892,9 +17451,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s2", @@ -18912,6 +17471,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 6, + }, Object { "$ref": 7, }, @@ -18921,17 +17483,14 @@ Object { Object { "$ref": 9, }, - Object { - "$ref": 10, - }, ], "type": "interface", "upperScope": Object { - "$ref": 12, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [], }, @@ -18940,9 +17499,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -18965,9 +17524,9 @@ Object { }, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "Symbol", @@ -18982,9 +17541,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -19007,9 +17566,9 @@ Object { }, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "Symbol", @@ -19026,18 +17585,15 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object { - "A": Object { - "$ref": 2, - }, "s1": Object { "$ref": 0, }, @@ -19046,7 +17602,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [ Object { @@ -19078,7 +17634,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "s1", @@ -19092,17 +17648,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 3, + "$ref": 2, }, Object { - "$ref": 7, + "$ref": 6, }, Object { - "$ref": 9, + "$ref": 8, }, ], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, Object { @@ -19134,7 +17690,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "s2", @@ -19148,57 +17704,17 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 5, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, + "$ref": 4, }, - ], - "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", + "$ref": 7, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "A", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", + "$ref": 9, }, ], - "name": "A", - "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, ], @@ -19207,7 +17723,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 0, @@ -19217,7 +17733,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 10, "block": Object { "range": Array [ 35, @@ -19230,9 +17746,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 7, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s1", @@ -19249,9 +17765,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 7, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s2", @@ -19268,9 +17784,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s1", @@ -19287,9 +17803,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 10, }, "identifier": Object { "name": "s2", @@ -19307,6 +17823,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 6, + }, Object { "$ref": 7, }, @@ -19316,17 +17835,14 @@ Object { Object { "$ref": 9, }, - Object { - "$ref": 10, - }, ], "type": "type-alias", "upperScope": Object { - "$ref": 12, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [], }, @@ -19335,9 +17851,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -19360,9 +17876,9 @@ Object { }, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "Symbol", @@ -19377,9 +17893,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -19402,9 +17918,9 @@ Object { }, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "Symbol", @@ -19421,18 +17937,15 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object { - "A": Object { - "$ref": 2, - }, "s1": Object { "$ref": 0, }, @@ -19441,7 +17954,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [ Object { @@ -19473,7 +17986,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "s1", @@ -19487,17 +18000,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 3, + "$ref": 2, }, Object { - "$ref": 7, + "$ref": 6, }, Object { - "$ref": 9, + "$ref": 8, }, ], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, Object { @@ -19529,7 +18042,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "s2", @@ -19543,74 +18056,34 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 5, + "$ref": 4, }, Object { - "$ref": 8, + "$ref": 7, }, Object { - "$ref": 10, + "$ref": 9, }, ], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, - 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 [ + ], +} +`; + +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 { @@ -19739,7 +18212,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "f", @@ -19766,7 +18239,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19776,7 +18249,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19789,9 +18262,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Map", @@ -19806,9 +18279,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Key", @@ -19819,15 +18292,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Value", @@ -19838,15 +18309,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "subject", @@ -19858,125 +18327,37 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 1, }, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, ], "type": "empty-function", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { - "Key": Object { - "$ref": 1, - }, - "Value": Object { - "$ref": 2, - }, "subject": Object { - "$ref": 3, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "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 { @@ -20012,11 +18393,11 @@ Object { "name": "subject", "references": Array [ Object { - "$ref": 7, + "$ref": 5, }, ], "scope": Object { - "$ref": 8, + "$ref": 6, }, }, ], @@ -20026,6 +18407,12 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, @@ -20038,7 +18425,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -20064,7 +18451,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "eachr", @@ -20078,7 +18465,7 @@ Object { "name": "eachr", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -20440,7 +18827,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", @@ -20658,7 +19045,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -20912,7 +19299,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -21123,7 +19510,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -21377,7 +19764,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -21631,7 +20018,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -22120,7 +20507,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "dec", @@ -22164,7 +20551,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "gec", @@ -22211,7 +20598,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "C", @@ -22234,7 +20621,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/empty-body-function.ts 1`] = ` Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, @@ -22244,7 +20631,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -22257,9 +20644,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Map", @@ -22274,9 +20661,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Key", @@ -22287,15 +20674,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "Value", @@ -22306,15 +20691,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 6, }, "identifier": Object { "name": "subject", @@ -22326,33 +20709,33 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 1, }, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, ], "type": "empty-function", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { - "Key": Object { - "$ref": 1, - }, - "Value": Object { - "$ref": 2, - }, "subject": Object { - "$ref": 3, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -22360,131 +20743,43 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Key", + "name": "subject", "range": Array [ - 15, - 18, + 27, + 51, ], "type": "Identifier", }, "node": Object { "range": Array [ - 14, - 26, + 0, + 69, ], - "type": "TSTypeParameterDeclaration", + "type": "TSDeclareFunction", }, "parent": null, - "type": "TypeParameter", + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Key", + "name": "subject", "range": Array [ - 15, - 18, + 27, + 51, ], "type": "Identifier", }, ], - "name": "Key", + "name": "subject", "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, + "$ref": 6, }, }, ], @@ -22494,6 +20789,12 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, @@ -22506,7 +20807,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -22532,7 +20833,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "eachr", @@ -22546,7 +20847,7 @@ Object { "name": "eachr", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -22971,7 +21272,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", @@ -23021,7 +21322,7 @@ Object { "type": "EnumName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "E", @@ -23191,7 +21492,7 @@ Object { "type": "EnumName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -23572,7 +21873,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", @@ -23622,7 +21923,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "b", @@ -23672,7 +21973,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "c", @@ -23722,7 +22023,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "d", @@ -23772,7 +22073,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "e", @@ -23822,7 +22123,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "f", @@ -24073,7 +22374,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "f", @@ -24237,7 +22538,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "f", @@ -24491,7 +22792,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Test", @@ -24514,7 +22815,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 13, + "$id": 10, "block": Object { "range": Array [ 0, @@ -24524,7 +22825,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24539,16 +22840,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 13, + "$ref": 10, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [], }, Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 16, @@ -24561,9 +22862,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 6, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 4, }, "identifier": Object { "name": "A", @@ -24574,29 +22875,27 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 6, + "$ref": 3, }, ], "type": "interface", "upperScope": Object { - "$ref": 13, + "$ref": 10, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [], }, Object { - "$id": 12, + "$id": 9, "block": Object { "range": Array [ 45, @@ -24609,9 +22908,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 8, + "$id": 5, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "B", @@ -24622,15 +22921,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 6, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "a", @@ -24642,14 +22939,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 0, }, "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 7, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -24660,15 +22957,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 8, "from": Object { - "$ref": 12, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -24679,33 +22974,31 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 8, + "$ref": 5, }, Object { - "$ref": 9, + "$ref": 6, }, Object { - "$ref": 10, + "$ref": 7, }, Object { - "$ref": 11, + "$ref": 8, }, ], "type": "interface", "upperScope": Object { - "$ref": 13, + "$ref": 10, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [], }, @@ -24714,9 +23007,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 13, + "$ref": 10, }, "identifier": Object { "name": "C", @@ -24727,31 +23020,36 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 0, + "throughReferences": Array [ + Object { + "$ref": 3, }, - "B": Object { - "$ref": 1, + Object { + "$ref": 5, }, - "C": Object { - "$ref": 2, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, }, + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object { "a": Object { - "$ref": 3, + "$ref": 0, }, }, "variableScope": Object { - "$ref": 13, + "$ref": 10, }, "variables": Array [ Object { @@ -24759,187 +23057,49 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "a", "range": Array [ - 5, - 6, + 110, + 114, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 15, + 110, + 114, ], - "type": "TSTypeAliasDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "TypeAliasName", + "parent": Object { + "range": Array [ + 106, + 114, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "A", + "name": "a", "range": Array [ - 5, - 6, + 110, + 114, ], "type": "Identifier", }, ], - "name": "A", + "name": "a", "references": Array [ Object { "$ref": 6, }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, ], "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 16, - 44, - ], - "type": "TSInterfaceDeclaration", - }, - "parent": null, - "type": "InterfaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [ - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$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 [ - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 13, + "$ref": 10, }, }, ], @@ -24995,7 +23155,7 @@ Object { "type": "ImportBinding", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "foo", @@ -25043,7 +23203,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/interface-type.ts 1`] = ` Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, @@ -25053,7 +23213,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25068,16 +23228,16 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [], }, Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 27, @@ -25090,9 +23250,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 5, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 3, }, "identifier": Object { "name": "C", @@ -25103,24 +23263,22 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 2, }, ], "type": "interface", "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [], }, @@ -25129,9 +23287,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 3, + "$id": 0, "from": Object { - "$ref": 7, + "$ref": 4, }, "identifier": Object { "name": "C", @@ -25142,235 +23300,75 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { - "$ref": 1, + "throughReferences": Array [ + Object { + "$ref": 0, }, - "R": Object { + Object { "$ref": 2, }, - "T": Object { - "$ref": 0, - }, - }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, - "variables": Array [ + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 143, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 5, + "block": Object { + "range": Array [ + 28, + 142, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "name": Object { - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 20, - ], - "type": "TSTypeParameterDeclaration", + "$id": 4, + "from": Object { + "$ref": 5, }, - "parent": null, - "type": "TypeParameter", - }, - Object { - "name": Object { - "name": "T", + "identifier": Object { + "name": "text", "range": Array [ - 39, - 40, + 116, + 120, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 38, - 51, - ], - "type": "TSTypeParameterDeclaration", + "kind": "r", + "resolved": Object { + "$ref": 0, }, - "parent": null, - "type": "TypeParameter", + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, + "throughReferences": Array [ Object { - "name": "T", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - ], - "name": "T", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "type": "TSInterfaceDeclaration", - }, - "parent": null, - "type": "InterfaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 2, - "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": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 143, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 28, - 142, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "text", - "range": Array [ - 116, - 120, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, + "$ref": 4, }, ], "type": "function", @@ -25473,7 +23471,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "text", @@ -25520,7 +23518,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "Foo", @@ -25847,7 +23845,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "s", @@ -25894,7 +23892,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "A", @@ -26036,7 +24034,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "foo", @@ -26314,7 +24312,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", @@ -26361,7 +24359,7 @@ Object { "type": "NamespaceName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "N", @@ -26519,7 +24517,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "foo", @@ -26542,7 +24540,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -26552,7 +24550,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -26567,11 +24565,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -26582,62 +24580,17 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 0, @@ -26647,7 +24600,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -26662,16 +24615,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 12, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [], }, Object { - "$id": 11, + "$id": 10, "block": Object { "range": Array [ 32, @@ -26681,7 +24634,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 9, "block": Object { "range": Array [ 47, @@ -26694,9 +24647,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -26707,15 +24660,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -26726,49 +24677,47 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 8, + "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, ], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 10, }, "variableMap": Object { "a": Object { - "$ref": 7, + "$ref": 6, }, "arguments": Object { - "$ref": 6, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 9, }, "variables": Array [ Object { - "$id": 6, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, Object { - "$id": 7, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -26804,7 +24753,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, ], @@ -26815,27 +24764,27 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 8, + "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, ], "type": "class", "upperScope": Object { - "$ref": 12, + "$ref": 11, }, "variableMap": Object { "C": Object { - "$ref": 5, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [ Object { - "$id": 5, + "$id": 4, "defs": Array [ Object { "name": Object { @@ -26871,7 +24820,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 10, }, }, ], @@ -26881,9 +24830,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 12, + "$ref": 11, }, "identifier": Object { "name": "A", @@ -26894,82 +24843,37 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], "type": "global", "upperScope": null, "variableMap": Object { - "A": Object { - "$ref": 0, - }, "C": Object { - "$ref": 2, + "$ref": 1, }, "a": Object { - "$ref": 1, + "$ref": 0, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 11, }, "variables": Array [ Object { "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 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 [ - Object { - "$ref": 3, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -26997,7 +24901,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", @@ -27011,11 +24915,11 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -27037,7 +24941,7 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "C", @@ -27051,7 +24955,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, ], @@ -27060,7 +24964,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -27070,7 +24974,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -27085,11 +24989,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], }, @@ -27098,9 +25002,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "a", @@ -27121,9 +25025,9 @@ Object { }, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "A", @@ -27134,15 +25038,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "b", @@ -27157,9 +25059,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "a", @@ -27180,9 +25082,9 @@ Object { }, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "b", @@ -27197,9 +25099,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "A", @@ -27210,16 +25112,20 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -27232,69 +25138,17 @@ Object { ], "type": "global", "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 16, - ], - "type": "TSTypeAliasDeclaration", - }, - "parent": null, - "type": "TypeAliasName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], + "variables": Array [], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -27304,7 +25158,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -27319,18 +25173,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -27341,47 +25192,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, - }, - }, - Object { - "$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", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "T", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], - "name": "T", - "references": Array [], - "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -27399,7 +25210,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -27425,7 +25236,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "f", @@ -27439,7 +25250,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -27548,7 +25359,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", @@ -27689,7 +25500,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "test", @@ -27712,7 +25523,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof.ts 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -27722,7 +25533,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 23, @@ -27735,9 +25546,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { "name": "obj", @@ -27756,16 +25567,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 2, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], }, @@ -27774,9 +25585,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "obj", @@ -27803,15 +25614,12 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { - "B": Object { - "$ref": 1, - }, "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -27843,7 +25651,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", @@ -27857,54 +25665,14 @@ Object { "name": "obj", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - 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", + "$ref": 1, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "B", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", + "$ref": 2, }, ], - "name": "B", - "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -28123,7 +25891,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", @@ -28156,7 +25924,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` Object { - "$id": 17, + "$id": 15, "block": Object { "range": Array [ 0, @@ -28166,7 +25934,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 14, "block": Object { "range": Array [ 25, @@ -28179,9 +25947,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -28198,9 +25966,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "a", @@ -28215,9 +25983,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -28234,9 +26002,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "b", @@ -28251,9 +26019,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 6, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "T", @@ -28264,15 +26032,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 7, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -28289,9 +26055,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 8, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -28308,9 +26074,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 9, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "a", @@ -28325,9 +26091,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 10, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -28344,9 +26110,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 11, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "b", @@ -28361,9 +26127,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 12, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "T", @@ -28374,15 +26140,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 13, "from": Object { - "$ref": 16, + "$ref": 14, }, "identifier": Object { "name": "obj", @@ -28400,6 +26164,12 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, Object { "$ref": 4, }, @@ -28412,6 +26182,9 @@ Object { Object { "$ref": 7, }, + Object { + "$ref": 8, + }, Object { "$ref": 9, }, @@ -28427,107 +26200,25 @@ Object { Object { "$ref": 13, }, - Object { - "$ref": 15, - }, ], "type": "interface", "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { - "T": Object { - "$ref": 3, - }, + "$ref": 15, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 17, + "$ref": 15, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 17, + "$ref": 15, }, "identifier": Object { "name": "obj", @@ -28551,31 +26242,34 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 3, + }, Object { "$ref": 5, }, Object { - "$ref": 7, + "$ref": 6, + }, + Object { + "$ref": 9, }, Object { "$ref": 11, }, Object { - "$ref": 13, + "$ref": 12, }, ], "type": "global", "upperScope": null, "variableMap": Object { - "A": Object { - "$ref": 1, - }, "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 17, + "$ref": 15, }, "variables": Array [ Object { @@ -28607,7 +26301,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", @@ -28620,6 +26314,9 @@ Object { ], "name": "obj", "references": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -28627,80 +26324,37 @@ Object { "$ref": 4, }, Object { - "$ref": 6, + "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { "$ref": 10, }, Object { - "$ref": 12, - }, - Object { - "$ref": 15, + "$ref": 13, }, ], "scope": Object { - "$ref": 17, + "$ref": 15, }, }, - 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-in-return-type.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ + ], +} +`; + +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 { @@ -28847,7 +26501,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "f", @@ -28870,7 +26524,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -28880,7 +26534,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -28893,9 +26547,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "g", @@ -28907,14 +26561,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 2, }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -28925,30 +26579,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, "g": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -28959,55 +26612,11 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, 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 { @@ -29043,11 +26652,11 @@ Object { "name": "g", "references": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -29056,7 +26665,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object { @@ -29065,7 +26678,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -29091,7 +26704,7 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "g", @@ -29105,7 +26718,7 @@ Object { "name": "g", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -29334,7 +26947,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", @@ -29393,7 +27006,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj2", @@ -29443,7 +27056,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "value", @@ -29493,7 +27106,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "element", @@ -29520,7 +27133,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -29530,7 +27143,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -29545,11 +27158,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -29560,56 +27173,11 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "variables": Array [ - Object { - "$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", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "variables": Array [], } `; @@ -29668,7 +27236,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -29744,7 +27312,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -29862,7 +27430,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -29885,7 +27453,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-infer.ts 1`] = ` Object { - "$id": 14, + "$id": 12, "block": Object { "range": Array [ 0, @@ -29895,7 +27463,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 11, "block": Object { "range": Array [ 0, @@ -29908,9 +27476,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -29921,15 +27489,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -29944,9 +27510,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -29961,9 +27527,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -29974,15 +27540,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -29997,9 +27561,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -30014,9 +27578,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 6, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -30027,15 +27591,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 7, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "Promise", @@ -30050,9 +27612,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 8, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -30067,9 +27629,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 9, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -30084,9 +27646,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 10, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -30097,19 +27659,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, Object { "$ref": 4, }, + Object { + "$ref": 5, + }, Object { "$ref": 6, }, @@ -30117,94 +27689,48 @@ Object { "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { - "$ref": 10, + "$ref": 9, }, Object { - "$ref": 11, + "$ref": 10, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 12, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 12, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, Object { "$ref": 4, }, + Object { + "$ref": 5, + }, Object { "$ref": 6, }, @@ -30212,73 +27738,28 @@ Object { "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { - "$ref": 10, + "$ref": 9, }, Object { - "$ref": 11, + "$ref": 10, }, ], "type": "global", "upperScope": null, - "variableMap": Object { - "Unpacked": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 12, }, - "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, - }, - }, - ], + "variables": Array [], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -30288,7 +27769,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -30301,9 +27782,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -30314,15 +27795,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "LinkedList", @@ -30333,15 +27812,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -30352,140 +27829,53 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "LinkedList": Object { + "throughReferences": Array [ + Object { "$ref": 0, }, - }, - "variableScope": Object { - "$ref": 6, - }, - "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, - }, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], } `; @@ -30566,7 +27956,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -30664,7 +28054,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -30762,7 +28152,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -30860,7 +28250,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -30883,7 +28273,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -30893,7 +28283,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -30908,11 +28298,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -30923,62 +28313,17 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -30988,7 +28333,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -31003,11 +28348,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -31018,56 +28363,11 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], } `; @@ -31148,7 +28448,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -31246,7 +28546,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -31364,7 +28664,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -31440,7 +28740,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -31516,7 +28816,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -31592,7 +28892,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -31668,7 +28968,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -31691,7 +28991,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -31701,7 +29001,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -31716,11 +29016,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -31731,56 +29031,11 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], } `; @@ -31839,7 +29094,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", @@ -31940,7 +29195,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -31986,7 +29241,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "y", @@ -32084,7 +29339,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -32169,7 +29424,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "union", @@ -32215,7 +29470,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "intersection", @@ -32261,7 +29516,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "precedence1", @@ -32307,7 +29562,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "precedence2", @@ -32330,7 +29585,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32340,7 +29595,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -32355,11 +29610,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -32370,55 +29625,10 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], } `; diff --git a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap index eade98ea309d..98a3720fdb4a 100644 --- a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap @@ -102,7 +102,7 @@ Object { exports[`TSX fixtures/react-typed-props.src 1`] = ` Object { - "$id": 10, + "$id": 9, "block": Object { "range": Array [ 0, @@ -112,7 +112,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -122,7 +122,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 31, @@ -137,16 +137,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], }, Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 80, @@ -159,9 +159,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Props", @@ -172,15 +172,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 6, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "props", @@ -192,45 +190,45 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 5, + "$ref": 4, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 6, + "$ref": 5, }, ], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { "arguments": Object { - "$ref": 4, + "$ref": 3, }, "props": Object { - "$ref": 5, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, + "$id": 3, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, Object { - "$id": 5, + "$id": 4, "defs": Array [ Object { "name": Object { @@ -266,11 +264,11 @@ Object { "name": "props", "references": Array [ Object { - "$ref": 7, + "$ref": 6, }, ], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -279,16 +277,17 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 9, }, "variableMap": Object { "App": Object { - "$ref": 2, - }, - "Props": Object { "$ref": 1, }, "React": Object { @@ -296,7 +295,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [ Object { @@ -342,55 +341,11 @@ Object { "name": "React", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 8, }, }, 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 { @@ -426,7 +381,7 @@ Object { "name": "App", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 8, }, }, ], @@ -435,12 +390,16 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 9, }, "variables": Array [], } diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index 65fe153afbb5..6665e7932ebc 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": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12,7 +12,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22,7 +22,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37,18 +37,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -59,47 +56,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 2, }, }, ], @@ -111,7 +68,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "f": Object { @@ -119,7 +76,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -159,7 +116,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -173,7 +130,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -181,7 +138,7 @@ Object { exports[`typescript fixtures/babylon-convergence/type-parameters.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -191,7 +148,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -201,7 +158,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -216,18 +173,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -238,47 +192,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 2, }, }, ], @@ -290,7 +204,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "f": Object { @@ -298,7 +212,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -338,7 +252,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -352,7 +266,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -1575,7 +1489,7 @@ Object { exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -1585,7 +1499,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -1595,7 +1509,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 7, @@ -1610,11 +1524,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -1625,58 +1539,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "I": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -1687,7 +1556,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -2195,7 +2064,7 @@ Object { exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -2205,7 +2074,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2215,7 +2084,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -2228,9 +2097,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "X", @@ -2241,15 +2110,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "X", @@ -2260,15 +2127,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "b", @@ -2280,77 +2145,34 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 0, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { - "X": Object { - "$ref": 0, - }, "b": Object { - "$ref": 1, + "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "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 { @@ -2386,11 +2208,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -2399,14 +2221,21 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [], }, @@ -2414,12 +2243,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [], } @@ -3225,7 +3061,7 @@ Object { exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -3235,7 +3071,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -3245,7 +3081,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -3258,9 +3094,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -3275,9 +3111,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -3294,19 +3130,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], }, @@ -3316,66 +3152,21 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -3383,17 +3174,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -3401,7 +3192,7 @@ Object { exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -3411,7 +3202,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -3421,7 +3212,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -3434,9 +3225,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 4, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -3451,9 +3242,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -3470,242 +3261,26 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 3, + "$ref": 1, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 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 [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], "throughReferences": Array [ Object { "$ref": 0, @@ -3716,11 +3291,11 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -3740,19 +3315,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` +exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 15, + 18, ], "type": "Program", }, @@ -3762,7 +3337,106 @@ Object { "block": Object { "range": Array [ 0, - 15, + 18, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "y", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 15, ], "type": "Program", }, @@ -5342,7 +5016,7 @@ Object { exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5352,7 +5026,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5362,7 +5036,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5372,7 +5046,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 23, @@ -5387,18 +5061,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -5409,53 +5080,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 3, }, }, ], }, Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 51, @@ -5470,69 +5101,26 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 6, - }, "arguments": Object { - "$ref": 5, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { - "$id": 5, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 5, }, }, ], @@ -5544,7 +5132,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { "C": Object { @@ -5552,7 +5140,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -5592,7 +5180,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 6, }, }, ], @@ -5604,7 +5192,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object { "C": Object { @@ -5612,7 +5200,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -5652,7 +5240,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -5666,7 +5254,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } @@ -6467,7 +6055,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6477,7 +6065,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6487,7 +6075,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -6502,19 +6090,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 4, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { - "$id": 4, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -6550,7 +6138,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -6560,9 +6148,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "B", @@ -6577,9 +6165,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "Bar", @@ -6596,70 +6184,27 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, Object { - "$ref": 3, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { - "A": Object { - "$ref": 0, - }, "Foo": Object { - "$ref": 1, + "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, - "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": 6, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -6695,7 +6240,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -6706,17 +6251,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, Object { - "$ref": 3, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [], } @@ -6724,7 +6269,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -6734,7 +6279,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6744,7 +6289,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6759,19 +6304,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Foo": Object { - "$ref": 6, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { - "$id": 6, + "$id": 5, "defs": Array [ Object { "name": Object { @@ -6807,7 +6352,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -6817,9 +6362,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "B", @@ -6834,9 +6379,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "C", @@ -6851,9 +6396,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "D", @@ -6868,9 +6413,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Bar", @@ -6886,6 +6431,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -6895,68 +6443,22 @@ Object { Object { "$ref": 4, }, - Object { - "$ref": 5, - }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { - "A": Object { - "$ref": 0, - }, "Foo": Object { - "$ref": 1, + "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { "$id": 0, - "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": 8, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -6992,7 +6494,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -7002,6 +6504,9 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -7011,15 +6516,12 @@ Object { Object { "$ref": 4, }, - Object { - "$ref": 5, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], } @@ -7027,7 +6529,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -7037,7 +6539,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -7047,7 +6549,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -7057,7 +6559,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 20, @@ -7072,18 +6574,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -7094,47 +6593,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 3, }, }, ], @@ -7146,7 +6605,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -7154,7 +6613,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -7194,7 +6653,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -7206,7 +6665,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -7214,7 +6673,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -7254,7 +6713,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -7268,7 +6727,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [], } @@ -7276,7 +6735,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -7286,7 +6745,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -7296,7 +6755,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -7306,7 +6765,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 20, @@ -7319,9 +6778,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Bar", @@ -7338,23 +6797,20 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -7365,47 +6821,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 4, }, }, ], @@ -7416,12 +6832,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -7429,7 +6845,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -7469,7 +6885,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -7480,12 +6896,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -7493,7 +6909,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -7533,7 +6949,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -7544,14 +6960,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } @@ -8415,7 +7831,7 @@ Object { exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { - "$id": 11, + "$id": 10, "block": Object { "range": Array [ 0, @@ -8425,7 +7841,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 9, "block": Object { "range": Array [ 0, @@ -8435,7 +7851,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -8460,7 +7876,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { "arguments": Object { @@ -8485,7 +7901,7 @@ Object { ], }, Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 35, @@ -8500,18 +7916,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { - "T": Object { - "$ref": 5, - }, "arguments": Object { "$ref": 4, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -8522,53 +7935,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 5, }, }, ], }, Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 50, @@ -8583,26 +7956,26 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { "arguments": Object { - "$ref": 7, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { - "$id": 7, + "$id": 6, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -8614,7 +7987,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 10, + "$ref": 9, }, "variableMap": Object { "C": Object { @@ -8622,7 +7995,7 @@ Object { }, }, "variableScope": Object { - "$ref": 10, + "$ref": 9, }, "variables": Array [ Object { @@ -8662,7 +8035,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 8, }, }, ], @@ -8674,7 +8047,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 11, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -8682,7 +8055,7 @@ Object { }, }, "variableScope": Object { - "$ref": 10, + "$ref": 9, }, "variables": Array [ Object { @@ -8722,7 +8095,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, ], @@ -8736,7 +8109,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 10, }, "variables": Array [], } @@ -8744,7 +8117,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 26, + "$id": 22, "block": Object { "range": Array [ 0, @@ -8754,7 +8127,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 25, + "$id": 21, "block": Object { "range": Array [ 0, @@ -8764,7 +8137,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 15, + "$id": 12, "block": Object { "range": Array [ 0, @@ -8774,7 +8147,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 11, "block": Object { "range": Array [ 60, @@ -8789,11 +8162,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 15, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 12, }, "variables": Array [], }, @@ -8802,9 +8175,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 11, + "$id": 8, "from": Object { - "$ref": 15, + "$ref": 12, }, "identifier": Object { "name": "Constructor", @@ -8815,15 +8188,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 4, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 9, "from": Object { - "$ref": 15, + "$ref": 12, }, "identifier": Object { "name": "T", @@ -8834,15 +8205,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 9, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 10, "from": Object { - "$ref": 15, + "$ref": 12, }, "identifier": Object { "name": "Base", @@ -8854,92 +8223,48 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 10, + "$ref": 7, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 11, + "$ref": 8, + }, + Object { + "$ref": 9, }, ], "type": "function", "upperScope": Object { - "$ref": 25, + "$ref": 21, }, "variableMap": Object { "Base": Object { - "$ref": 10, - }, - "T": Object { - "$ref": 9, + "$ref": 7, }, "arguments": Object { - "$ref": 8, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 15, + "$ref": 12, }, "variables": Array [ Object { - "$id": 8, + "$id": 6, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 15, - }, - }, - Object { - "$id": 9, - "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": 12, - }, - ], - "scope": Object { - "$ref": 15, + "$ref": 12, }, }, Object { - "$id": 10, + "$id": 7, "defs": Array [ Object { "name": Object { @@ -8975,17 +8300,17 @@ Object { "name": "Base", "references": Array [ Object { - "$ref": 13, + "$ref": 10, }, ], "scope": Object { - "$ref": 15, + "$ref": 12, }, }, ], }, Object { - "$id": 17, + "$id": 14, "block": Object { "range": Array [ 86, @@ -9000,19 +8325,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 25, + "$ref": 21, }, "variableMap": Object { "X": Object { - "$ref": 16, + "$ref": 13, }, }, "variableScope": Object { - "$ref": 25, + "$ref": 21, }, "variables": Array [ Object { - "$id": 16, + "$id": 13, "defs": Array [ Object { "name": Object { @@ -9048,13 +8373,13 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 14, }, }, ], }, Object { - "$id": 19, + "$id": 16, "block": Object { "range": Array [ 130, @@ -9069,19 +8394,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 25, + "$ref": 21, }, "variableMap": Object { "C": Object { - "$ref": 18, + "$ref": 15, }, }, "variableScope": Object { - "$ref": 25, + "$ref": 21, }, "variables": Array [ Object { - "$id": 18, + "$id": 15, "defs": Array [ Object { "name": Object { @@ -9117,13 +8442,13 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 16, }, }, ], }, Object { - "$id": 20, + "$id": 17, "block": Object { "range": Array [ 142, @@ -9138,16 +8463,16 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 25, + "$ref": 21, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 25, + "$ref": 21, }, "variables": Array [], }, Object { - "$id": 24, + "$id": 20, "block": Object { "range": Array [ 158, @@ -9160,9 +8485,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 22, + "$id": 18, "from": Object { - "$ref": 24, + "$ref": 20, }, "identifier": Object { "name": "args", @@ -9177,9 +8502,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 23, + "$id": 19, "from": Object { - "$ref": 24, + "$ref": 20, }, "identifier": Object { "name": "T", @@ -9190,84 +8515,36 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 21, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 22, + "$ref": 18, + }, + Object { + "$ref": 19, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 25, - }, - "variableMap": Object { - "T": Object { - "$ref": 21, - }, + "$ref": 21, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 25, + "$ref": 21, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 25, + "$ref": 21, }, "identifier": Object { "name": "I", @@ -9278,15 +8555,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 25, + "$ref": 21, }, "identifier": Object { "name": "M", @@ -9303,9 +8578,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 25, + "$ref": 21, }, "identifier": Object { "name": "C", @@ -9324,23 +8599,29 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 22, + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 18, + }, + Object { + "$ref": 19, }, ], "type": "module", "upperScope": Object { - "$ref": 26, + "$ref": 22, }, "variableMap": Object { "C": Object { "$ref": 2, }, - "Constructor": Object { - "$ref": 4, - }, - "I": Object { - "$ref": 3, - }, "M": Object { "$ref": 0, }, @@ -9349,7 +8630,7 @@ Object { }, }, "variableScope": Object { - "$ref": 25, + "$ref": 21, }, "variables": Array [ Object { @@ -9389,11 +8670,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 6, + "$ref": 4, }, ], "scope": Object { - "$ref": 25, + "$ref": 21, }, }, Object { @@ -9433,7 +8714,7 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 25, + "$ref": 21, }, }, Object { @@ -9471,101 +8752,13 @@ Object { }, ], "name": "C", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$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": 5, }, ], "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": 11, - }, - ], - "scope": Object { - "$ref": 25, + "$ref": 21, }, }, ], @@ -9576,14 +8769,26 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 22, + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 18, + }, + Object { + "$ref": 19, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 26, + "$ref": 22, }, "variables": Array [], } @@ -9591,7 +8796,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -9601,7 +8806,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -9611,7 +8816,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -9624,9 +8829,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "Constructor", @@ -9641,9 +8846,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "M", @@ -9660,9 +8865,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -9673,13 +8878,14 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 3, + }, Object { "$ref": 4, }, @@ -9689,13 +8895,10 @@ Object { ], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Base": Object { - "$ref": 3, - }, - "T": Object { "$ref": 2, }, "arguments": Object { @@ -9703,7 +8906,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -9714,55 +8917,11 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, 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 { @@ -9798,7 +8957,7 @@ Object { "name": "Base", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -9809,12 +8968,15 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, + }, + Object { + "$ref": 5, }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { "M": Object { @@ -9822,7 +8984,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -9862,11 +9024,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 5, + "$ref": 4, }, ], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -9877,14 +9039,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, + }, + Object { + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], } @@ -13311,7 +12476,7 @@ Object { exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, @@ -13321,7 +12486,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, @@ -13331,7 +12496,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -13341,7 +12506,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 25, @@ -13356,18 +12521,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -13378,53 +12540,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 3, }, }, ], }, Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 63, @@ -13439,69 +12561,26 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 6, - }, "arguments": Object { - "$ref": 5, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { - "$id": 5, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 5, }, }, ], @@ -13513,7 +12592,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { "A": Object { @@ -13521,7 +12600,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -13561,7 +12640,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 6, }, }, ], @@ -13573,7 +12652,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object { "A": Object { @@ -13581,7 +12660,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -13621,7 +12700,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -13635,7 +12714,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } @@ -13643,7 +12722,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -13653,7 +12732,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -13663,7 +12742,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -13678,19 +12757,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -13726,7 +12805,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -13738,62 +12817,19 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { "$id": 0, - "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": 4, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -13829,7 +12865,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -13843,7 +12879,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -13851,7 +12887,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -13861,7 +12897,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -13871,7 +12907,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -13886,19 +12922,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -13934,7 +12970,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -13944,9 +12980,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Bar", @@ -13963,67 +12999,24 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { "$id": 0, - "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": 5, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -14059,7 +13052,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -14070,14 +13063,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [], } @@ -14085,7 +13078,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -14095,7 +13088,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14105,7 +13098,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -14120,19 +13113,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "A": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -14168,7 +13161,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -14180,62 +13173,19 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "A": Object { - "$ref": 1, - }, - "__P": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { "$id": 0, - "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": 4, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -14271,7 +13221,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -14285,7 +13235,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -17385,7 +16335,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -17395,7 +16345,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -17405,7 +16355,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 15, @@ -17420,11 +16370,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -17435,58 +16385,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "T": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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": 2, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -17497,7 +16402,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -17505,7 +16410,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -17515,7 +16420,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, @@ -17525,7 +16430,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ 15, @@ -17540,11 +16445,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [], }, @@ -17555,101 +16460,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "T": Object { - "$ref": 0, - }, - "U": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 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": 3, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "U", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 26, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "U", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - ], - "name": "U", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -17660,7 +16477,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } @@ -17668,7 +16485,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17678,7 +16495,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17688,7 +16505,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 7, @@ -17703,19 +16520,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -17751,7 +16568,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -17763,62 +16580,19 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { "$id": 0, - "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": 4, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -17854,7 +16628,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -17868,7 +16642,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -17876,7 +16650,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17886,7 +16660,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17896,7 +16670,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 7, @@ -17911,19 +16685,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 3, }, "variableMap": Object { "Foo": Object { - "$ref": 3, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -17959,7 +16733,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -17971,105 +16745,19 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 2, - }, - "T": Object { "$ref": 0, }, - "U": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [ Object { "$id": 0, - "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": 5, - }, - }, - Object { - "$id": 1, - "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": 5, - }, - }, - Object { - "$id": 2, "defs": Array [ Object { "name": Object { @@ -18105,7 +16793,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 3, }, }, ], @@ -18119,7 +16807,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, "variables": Array [], } @@ -18770,7 +17458,7 @@ Object { exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -18780,7 +17468,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -18790,7 +17478,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 7, @@ -18805,11 +17493,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -18820,58 +17508,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "TestAlias": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -18882,7 +17525,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -18890,7 +17533,7 @@ Object { exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -18900,7 +17543,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -18910,7 +17553,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 7, @@ -18925,11 +17568,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -18940,58 +17583,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "TestClassProps": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -19002,7 +17600,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -19010,7 +17608,7 @@ Object { exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19020,7 +17618,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -19030,7 +17628,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 7, @@ -19043,9 +17641,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "a", @@ -19062,16 +17660,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -19081,63 +17679,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "TestCallback": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -19145,14 +17698,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -19160,7 +17713,7 @@ Object { exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19170,7 +17723,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19180,7 +17733,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 10, @@ -19193,9 +17746,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "a", @@ -19207,7 +17760,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 4, + "$ref": 3, }, "writeExpr": undefined, }, @@ -19215,21 +17768,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "a": Object { - "$ref": 4, + "$ref": 3, }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -19240,51 +17790,11 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, 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 { @@ -19320,11 +17830,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 5, + "$ref": 4, }, ], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -19336,7 +17846,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "obj", @@ -19362,7 +17872,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "obj": Object { @@ -19370,7 +17880,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -19420,7 +17930,7 @@ Object { }, ], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -19434,7 +17944,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } @@ -20602,7 +19112,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -20612,7 +19122,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -20622,7 +19132,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -20635,9 +19145,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "X", @@ -20648,15 +19158,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "X", @@ -20667,15 +19175,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "b", @@ -20687,29 +19193,33 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 2, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { - "X": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -20720,58 +19230,11 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, 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 { @@ -20807,11 +19270,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 6, + "$ref": 5, }, ], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -20820,10 +19283,17 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { "a": Object { @@ -20831,7 +19301,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -20871,7 +19341,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -20880,12 +19350,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], } @@ -20893,7 +19370,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters-that-have-comments.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -20903,7 +19380,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -20913,7 +19390,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -20928,18 +19405,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -20950,47 +19424,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 2, }, }, ], @@ -21002,7 +19436,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "compare": Object { @@ -21010,7 +19444,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -21050,7 +19484,7 @@ Object { "name": "compare", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -21064,7 +19498,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -21072,7 +19506,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -21082,7 +19516,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -21092,7 +19526,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -21105,9 +19539,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "X", @@ -21118,15 +19552,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "X", @@ -21137,15 +19569,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "b", @@ -21157,29 +19587,33 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 2, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { - "X": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -21190,58 +19624,11 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, 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 { @@ -21277,11 +19664,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 6, + "$ref": 5, }, ], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -21290,10 +19677,17 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { "a": Object { @@ -21301,7 +19695,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -21341,7 +19735,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -21350,12 +19744,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], } @@ -22360,7 +20761,7 @@ Object { exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -22370,7 +20771,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22380,7 +20781,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ 0, @@ -22395,16 +20796,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 6, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, "variables": Array [], }, Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 29, @@ -22417,9 +20818,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "X", @@ -22434,9 +20835,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "Y", @@ -22451,225 +20852,6 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "type-alias", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - "B": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 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 [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "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, @@ -22704,56 +20886,11 @@ Object { "upperScope": Object { "$ref": 5, }, - "variableMap": Object { - "X": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -22777,7 +20914,7 @@ Object { } `; -exports[`typescript fixtures/basics/interface-extends.src 1`] = ` +exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` Object { "$id": 4, "block": Object { @@ -22805,22 +20942,39 @@ Object { 0, 30, ], - "type": "TSInterfaceDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, Object { "$id": 1, "from": Object { "$ref": 2, }, "identifier": Object { - "name": "Bar", + "name": "B", "range": Array [ 22, - 25, + 23, ], "type": "Identifier", }, @@ -22830,11 +20984,14 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, ], - "type": "interface", + "type": "type-alias", "upperScope": Object { "$ref": 3, }, @@ -22849,6 +21006,9 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, @@ -22857,56 +21017,119 @@ Object { "upperScope": Object { "$ref": 4, }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, - "variables": Array [ + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-extends.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 1, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "Foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", + "$id": 0, + "from": Object { + "$ref": 1, }, - "node": Object { + "identifier": Object { + "name": "Bar", "range": Array [ - 0, - 30, + 22, + 25, ], - "type": "TSInterfaceDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "InterfaceName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "Foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", + "$ref": 0, }, ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 3, + "type": "interface", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, }, ], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -22914,14 +21137,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -22929,7 +21152,7 @@ Object { exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22939,7 +21162,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22949,7 +21172,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22962,9 +21185,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "Bar", @@ -22979,9 +21202,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "Baz", @@ -22998,19 +21221,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], }, @@ -23020,66 +21243,21 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -23087,17 +21265,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -23105,7 +21283,7 @@ Object { exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -23115,7 +21293,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, @@ -23125,7 +21303,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ 0, @@ -23140,11 +21318,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [], }, @@ -23155,101 +21333,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - "T": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "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": 3, - }, - }, - Object { - "$id": 1, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -23260,7 +21350,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } @@ -23268,7 +21358,7 @@ Object { exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 21, + "$id": 18, "block": Object { "range": Array [ 0, @@ -23278,7 +21368,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 20, + "$id": 17, "block": Object { "range": Array [ 0, @@ -23288,7 +21378,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 19, + "$id": 16, "block": Object { "range": Array [ 0, @@ -23301,9 +21391,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 0, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "bax", @@ -23318,9 +21408,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "baz", @@ -23335,9 +21425,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 2, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -23352,9 +21442,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 3, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -23369,9 +21459,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 4, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "c", @@ -23386,9 +21476,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 5, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "loo", @@ -23403,9 +21493,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 6, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -23420,9 +21510,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 7, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -23437,9 +21527,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 8, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "c", @@ -23454,9 +21544,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 9, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -23471,9 +21561,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 10, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -23488,9 +21578,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 11, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "c", @@ -23505,9 +21595,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 12, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -23522,9 +21612,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 16, + "$id": 13, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -23539,9 +21629,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 14, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -23556,9 +21646,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 18, + "$id": 15, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -23574,6 +21664,15 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -23613,119 +21712,31 @@ Object { Object { "$ref": 15, }, - Object { - "$ref": 16, - }, - Object { - "$ref": 17, - }, - Object { - "$ref": 18, - }, ], "type": "interface", "upperScope": Object { - "$ref": 20, - }, - "variableMap": Object { - "F": Object { - "$ref": 2, - }, - "J": Object { - "$ref": 1, - }, + "$ref": 17, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 20, + "$ref": 17, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -23765,76 +21776,31 @@ Object { Object { "$ref": 15, }, - Object { - "$ref": 16, - }, - Object { - "$ref": 17, - }, - Object { - "$ref": 18, - }, ], "type": "module", "upperScope": Object { - "$ref": 21, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 18, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 20, + "$ref": 17, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -23874,21 +21840,12 @@ Object { Object { "$ref": 15, }, - Object { - "$ref": 16, - }, - Object { - "$ref": 17, - }, - Object { - "$ref": 18, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 21, + "$ref": 18, }, "variables": Array [], } @@ -23896,7 +21853,7 @@ Object { exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -23906,7 +21863,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -23916,7 +21873,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -23929,9 +21886,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "x", @@ -23946,9 +21903,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "y", @@ -23965,19 +21922,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], }, @@ -23987,66 +21944,21 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Test": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -24054,17 +21966,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -24072,7 +21984,7 @@ Object { exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24082,7 +21994,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24092,7 +22004,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24105,9 +22017,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -24124,16 +22036,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -24143,63 +22055,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -24207,14 +22074,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -24222,7 +22089,7 @@ Object { exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -24232,7 +22099,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24242,7 +22109,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24255,9 +22122,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 4, + "$ref": 2, }, "identifier": Object { "name": "Bar", @@ -24272,9 +22139,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 2, }, "identifier": Object { "name": "J", @@ -24291,19 +22158,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 3, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 5, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [], }, @@ -24313,109 +22180,21 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 3, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - "T": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, - "variables": Array [ - Object { - "$id": 0, - "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": 5, - }, - }, - Object { - "$id": 1, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -24423,17 +22202,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 3, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, "variables": Array [], } @@ -24441,7 +22220,7 @@ Object { exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24451,7 +22230,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24461,7 +22240,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ 0, @@ -24476,11 +22255,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [], }, @@ -24491,101 +22270,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "T": Object { - "$ref": 0, - }, - "Test": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "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": 3, - }, - }, - Object { - "$id": 1, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -24596,7 +22287,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } @@ -24604,7 +22295,7 @@ Object { exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24614,7 +22305,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24624,7 +22315,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24637,9 +22328,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -24656,16 +22347,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -24675,63 +22366,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Test": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -24739,14 +22385,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -24754,7 +22400,7 @@ Object { exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -24764,7 +22410,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -24774,7 +22420,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -24787,9 +22433,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "bar", @@ -24804,9 +22450,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "bar", @@ -24821,9 +22467,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -24834,15 +22480,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -24853,13 +22497,17 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -24869,71 +22517,25 @@ Object { ], "type": "interface", "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 5, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -24943,64 +22545,25 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "test": Object { - "$ref": 0, - }, + "$ref": 6, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -25012,7 +22575,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 6, }, "variables": Array [], } @@ -25020,7 +22583,7 @@ Object { exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -25030,7 +22593,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -25040,7 +22603,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25053,9 +22616,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { "name": "foo", @@ -25070,9 +22633,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { "name": "bar", @@ -25087,9 +22650,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { "name": "baz", @@ -25106,22 +22669,22 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, Object { - "$ref": 3, + "$ref": 2, }, ], "type": "interface", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], }, @@ -25131,69 +22694,24 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, Object { - "$ref": 3, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "test": Object { - "$ref": 0, - }, + "$ref": 5, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -25201,20 +22719,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, Object { - "$ref": 3, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [], } @@ -25222,7 +22740,7 @@ Object { exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25232,7 +22750,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25242,7 +22760,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -25257,11 +22775,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -25272,58 +22790,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "test": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -25334,7 +22807,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -25342,7 +22815,7 @@ Object { exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25352,7 +22825,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25362,7 +22835,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25375,9 +22848,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "foo", @@ -25394,16 +22867,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -25413,63 +22886,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -25477,14 +22905,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -27807,7 +25235,7 @@ Object { exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { - "$id": 14, + "$id": 12, "block": Object { "range": Array [ 0, @@ -27817,7 +25245,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 11, "block": Object { "range": Array [ 0, @@ -27827,7 +25255,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 29, @@ -27842,18 +25270,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 13, + "$ref": 11, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -27864,53 +25289,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 3, }, }, ], }, Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 68, @@ -27925,75 +25310,32 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 13, + "$ref": 11, }, "variableMap": Object { - "T": Object { - "$ref": 6, - }, "arguments": Object { - "$ref": 5, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { - "$id": 5, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 5, }, }, ], }, Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 109, @@ -28008,32 +25350,32 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 13, + "$ref": 11, }, "variableMap": Object { "arguments": Object { - "$ref": 8, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { - "$id": 8, + "$id": 6, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], }, Object { - "$id": 12, + "$id": 10, "block": Object { "range": Array [ 147, @@ -28048,33 +25390,33 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 13, + "$ref": 11, }, "variableMap": Object { "arguments": Object { - "$ref": 10, + "$ref": 8, }, "x": Object { - "$ref": 11, + "$ref": 9, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 10, }, "variables": Array [ Object { - "$id": 10, + "$id": 8, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 10, }, }, Object { - "$id": 11, + "$id": 9, "defs": Array [ Object { "name": Object { @@ -28110,7 +25452,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 10, }, }, ], @@ -28122,7 +25464,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "foo", @@ -28148,7 +25490,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 14, + "$ref": 12, }, "variableMap": Object { "foo": Object { @@ -28156,7 +25498,7 @@ Object { }, }, "variableScope": Object { - "$ref": 13, + "$ref": 11, }, "variables": Array [ Object { @@ -28206,7 +25548,7 @@ Object { }, ], "scope": Object { - "$ref": 13, + "$ref": 11, }, }, ], @@ -28220,7 +25562,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 12, }, "variables": Array [], } @@ -31139,7 +28481,7 @@ Object { exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -31149,7 +28491,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -31159,7 +28501,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -31172,9 +28514,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "Success", @@ -31189,9 +28531,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -31202,15 +28544,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "Failure", @@ -31227,70 +28567,24 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, - "variables": Array [ - 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, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -31298,66 +28592,24 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Result": Object { - "$ref": 0, - }, + "$ref": 5, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSTypeAliasDeclaration", - }, - "parent": null, - "type": "TypeAliasName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", - }, - ], - "name": "Result", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -31365,17 +28617,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [], } @@ -31383,7 +28638,7 @@ Object { exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -31393,7 +28648,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -31403,7 +28658,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -31416,9 +28671,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "Success", @@ -31433,9 +28688,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -31446,15 +28701,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "Failure", @@ -31471,70 +28724,24 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 11, - 25, - ], - "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, - }, - ], - "scope": Object { - "$ref": 5, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -31542,66 +28749,24 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Result": Object { - "$ref": 0, - }, + "$ref": 5, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 48, - ], - "type": "TSTypeAliasDeclaration", - }, - "parent": null, - "type": "TypeAliasName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", - }, - ], - "name": "Result", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -31609,17 +28774,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [], } @@ -31627,7 +28795,7 @@ Object { exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -31637,7 +28805,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -31647,7 +28815,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -31662,11 +28830,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -31677,58 +28845,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 30, - ], - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -31739,7 +28862,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -32175,7 +29298,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-in-interface.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -32185,7 +29308,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32195,7 +29318,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32208,9 +29331,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "node", @@ -32225,9 +29348,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "node", @@ -32244,19 +29367,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], }, @@ -32266,66 +29389,21 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "AssertFoo": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -32333,17 +29411,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -33009,7 +30087,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-with-guard-in-interface.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -33019,7 +30097,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -33029,7 +30107,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -33042,9 +30120,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "node", @@ -33059,9 +30137,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "node", @@ -33078,19 +30156,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], }, @@ -33100,66 +30178,21 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "AssertFoo": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -33167,17 +30200,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -33887,7 +30920,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-interface.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -33897,7 +30930,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -33907,7 +30940,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -33920,9 +30953,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "node", @@ -33937,9 +30970,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "node", @@ -33956,19 +30989,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], }, @@ -33978,66 +31011,21 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$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, - 56, - ], - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -34045,17 +31033,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -34348,7 +31336,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` Object { - "$id": 12, + "$id": 10, "block": Object { "range": Array [ 0, @@ -34358,7 +31346,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 9, "block": Object { "range": Array [ 0, @@ -34368,7 +31356,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 44, @@ -34383,18 +31371,15 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 9, }, "variableMap": Object { - "A": Object { - "$ref": 5, - }, "arguments": Object { "$ref": 4, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -34405,53 +31390,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 5, }, }, ], }, Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 88, @@ -34464,9 +31409,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 9, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 8, }, "identifier": Object { "name": "Foo", @@ -34483,74 +31428,31 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 9, + "$ref": 7, }, ], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 9, }, "variableMap": Object { - "A": Object { - "$ref": 8, - }, "arguments": Object { - "$ref": 7, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [ Object { - "$id": 7, + "$id": 6, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$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, + "$ref": 8, }, }, ], @@ -34562,7 +31464,7 @@ Object { Object { "$id": 2, "from": Object { - "$ref": 11, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -34579,7 +31481,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 11, + "$ref": 9, }, "identifier": Object { "name": "foo", @@ -34602,12 +31504,12 @@ Object { "$ref": 3, }, Object { - "$ref": 9, + "$ref": 7, }, ], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 10, }, "variableMap": Object { "bar": Object { @@ -34618,7 +31520,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 9, }, "variables": Array [ Object { @@ -34658,7 +31560,7 @@ Object { "name": "bar", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 9, }, }, Object { @@ -34698,7 +31600,7 @@ Object { "name": "baz", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 9, }, }, ], @@ -34715,14 +31617,14 @@ Object { "$ref": 3, }, Object { - "$ref": 9, + "$ref": 7, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 10, }, "variables": Array [], } @@ -34730,7 +31632,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 20, + "$id": 17, "block": Object { "range": Array [ 0, @@ -34740,7 +31642,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 19, + "$id": 16, "block": Object { "range": Array [ 0, @@ -34750,7 +31652,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 7, "block": Object { "range": Array [ 0, @@ -34765,19 +31667,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 19, + "$ref": 16, }, "variableMap": Object { "foo": Object { - "$ref": 9, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 16, }, "variables": Array [ Object { - "$id": 9, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -34813,13 +31715,13 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 7, }, }, ], }, Object { - "$id": 12, + "$id": 9, "block": Object { "range": Array [ 75, @@ -34834,19 +31736,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 19, + "$ref": 16, }, "variableMap": Object { "foo2": Object { - "$ref": 11, + "$ref": 8, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 16, }, "variables": Array [ Object { - "$id": 11, + "$id": 8, "defs": Array [ Object { "name": Object { @@ -34882,13 +31784,13 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 9, }, }, ], }, Object { - "$id": 15, + "$id": 12, "block": Object { "range": Array [ 165, @@ -34901,9 +31803,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 13, + "$id": 10, "from": Object { - "$ref": 15, + "$ref": 12, }, "identifier": Object { "name": "bar2", @@ -34914,15 +31816,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 4, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 11, "from": Object { - "$ref": 15, + "$ref": 12, }, "identifier": Object { "name": "A", @@ -34933,32 +31833,30 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 13, + "$ref": 10, }, Object { - "$ref": 14, + "$ref": 11, }, ], "type": "interface", "upperScope": Object { - "$ref": 19, + "$ref": 16, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 19, + "$ref": 16, }, "variables": Array [], }, Object { - "$id": 18, + "$id": 15, "block": Object { "range": Array [ 245, @@ -34971,9 +31869,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 16, + "$id": 13, "from": Object { - "$ref": 18, + "$ref": 15, }, "identifier": Object { "name": "bar", @@ -34984,15 +31882,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 14, "from": Object { - "$ref": 18, + "$ref": 15, }, "identifier": Object { "name": "A", @@ -35003,27 +31899,25 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 16, + "$ref": 13, }, Object { - "$ref": 17, + "$ref": 14, }, ], "type": "interface", "upperScope": Object { - "$ref": 19, + "$ref": 16, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 19, + "$ref": 16, }, "variables": Array [], }, @@ -35032,9 +31926,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 2, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "A", @@ -35045,15 +31939,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 3, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "bar", @@ -35064,15 +31956,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 4, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "A", @@ -35083,15 +31973,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 5, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "bar", @@ -35102,174 +31990,54 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 20, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, + "throughReferences": Array [ + Object { + "$ref": 2, }, - "bar": Object { + Object { "$ref": 3, }, - "bar2": Object { + Object { "$ref": 4, }, + Object { + "$ref": 5, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object { "foo": Object { - "$ref": 1, + "$ref": 0, }, "foo2": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 16, }, "variables": Array [ Object { "$id": 0, - "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", - }, - Object { - "name": Object { - "name": "A", - "range": Array [ - 98, - 99, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 86, - 124, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - Object { - "name": Object { - "name": "A", - "range": Array [ - 191, - 192, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 179, - 203, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - Object { - "name": Object { - "name": "A", - "range": Array [ - 272, - 273, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 260, - 298, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - Object { - "name": "A", - "range": Array [ - 98, - 99, - ], - "type": "Identifier", - }, - Object { - "name": "A", - "range": Array [ - 191, - 192, - ], - "type": "Identifier", - }, - Object { - "name": "A", - "range": Array [ - 272, - 273, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [ - Object { - "$ref": 5, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 14, - }, - Object { - "$ref": 17, - }, - ], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -35305,11 +32073,11 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 16, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -35345,101 +32113,7 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 3, - "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": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 16, - }, - ], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 4, - "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": 13, - }, - ], - "scope": Object { - "$ref": 19, + "$ref": 16, }, }, ], @@ -35448,12 +32122,37 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 20, + "$ref": 17, }, "variables": Array [], } @@ -35656,7 +32355,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35666,7 +32365,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -35676,7 +32375,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -35691,11 +32390,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -35706,58 +32405,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -35768,7 +32422,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -35776,7 +32430,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35786,7 +32440,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -35796,7 +32450,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -35811,11 +32465,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -35826,58 +32480,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -35888,7 +32497,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -35896,7 +32505,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35906,7 +32515,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -35916,7 +32525,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -35931,11 +32540,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -35946,58 +32555,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36008,7 +32572,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36016,7 +32580,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36026,7 +32590,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36036,7 +32600,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -36051,11 +32615,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -36066,58 +32630,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36128,7 +32647,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36136,7 +32655,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36146,7 +32665,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36156,7 +32675,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -36171,11 +32690,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -36186,58 +32705,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36248,7 +32722,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36256,7 +32730,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36266,7 +32740,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36276,7 +32750,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -36291,11 +32765,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -36306,58 +32780,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36368,7 +32797,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36376,7 +32805,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36386,7 +32815,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36396,7 +32825,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -36411,11 +32840,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -36426,58 +32855,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36488,7 +32872,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36496,7 +32880,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36506,7 +32890,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36516,7 +32900,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -36531,11 +32915,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -36546,58 +32930,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36608,7 +32947,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36616,7 +32955,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36626,7 +32965,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36636,7 +32975,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -36651,11 +32990,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -36666,58 +33005,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36728,7 +33022,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36736,7 +33030,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36746,7 +33040,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36756,7 +33050,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -36771,11 +33065,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -36786,58 +33080,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36848,7 +33097,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36856,7 +33105,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36866,7 +33115,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36876,7 +33125,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -36891,11 +33140,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -36906,58 +33155,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -36968,7 +33172,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -36976,7 +33180,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36986,7 +33190,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36996,7 +33200,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -37011,11 +33215,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -37026,58 +33230,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -37088,7 +33247,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -37096,7 +33255,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37106,7 +33265,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -37116,7 +33275,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -37131,11 +33290,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -37146,58 +33305,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -37208,7 +33322,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -37216,7 +33330,7 @@ Object { exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -37226,7 +33340,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -37236,7 +33350,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -37249,9 +33363,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "bar", @@ -37266,9 +33380,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "bar", @@ -37283,9 +33397,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -37296,15 +33410,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -37315,13 +33427,17 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -37331,71 +33447,25 @@ Object { ], "type": "type-alias", "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 5, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -37405,64 +33475,25 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 6, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -37474,7 +33505,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 6, }, "variables": Array [], } @@ -37482,7 +33513,7 @@ Object { exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -37492,7 +33523,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -37502,7 +33533,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -37515,9 +33546,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "onclick", @@ -37532,9 +33563,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "this", @@ -37549,9 +33580,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "e", @@ -37566,9 +33597,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Event", @@ -37584,6 +33615,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, @@ -37593,17 +33627,14 @@ Object { Object { "$ref": 3, }, - Object { - "$ref": 4, - }, ], "type": "interface", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [], }, @@ -37612,6 +33643,9 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, @@ -37621,70 +33655,25 @@ Object { Object { "$ref": 3, }, - Object { - "$ref": 4, - }, ], "type": "module", "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "UIElement": Object { - "$ref": 0, - }, + "$ref": 6, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, @@ -37694,15 +33683,12 @@ Object { Object { "$ref": 3, }, - Object { - "$ref": 4, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [], } @@ -37710,7 +33696,7 @@ Object { exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37720,7 +33706,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -37730,7 +33716,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -37745,11 +33731,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -37760,58 +33746,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -37822,7 +33763,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -39225,7 +35166,7 @@ Object { exports[`typescript fixtures/declare/interface.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -39235,7 +35176,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -39245,7 +35186,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -39259,126 +35200,81 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 26, - ], - "type": "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/declare/module.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 24, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 19, - 23, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", + "upperScope": Object { + "$ref": 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/declare/module.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 24, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 24, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 19, + 23, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", "upperScope": Object { "$ref": 2, }, @@ -39585,7 +35481,7 @@ Object { exports[`typescript fixtures/declare/type-alias.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -39595,7 +35491,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -39605,7 +35501,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -39620,11 +35516,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -39635,58 +35531,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -39697,7 +35548,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -46438,7 +42289,7 @@ Object { exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -46448,7 +42299,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -46458,7 +42309,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -46473,11 +42324,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -46487,11 +42338,87 @@ Object { "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/errorRecovery/decorator-on-variable.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 18, + 19, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "module", "upperScope": Object { "$ref": 3, }, "variableMap": Object { - "M": Object { + "a": Object { "$ref": 0, }, }, @@ -46504,168 +42431,47 @@ Object { "defs": Array [ Object { "name": Object { - "name": "M", + "name": "a", "range": Array [ - 18, - 19, + 14, + 15, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 14, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 22, + 19, ], - "type": "TSInterfaceDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "InterfaceName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "M", + "name": "a", "range": Array [ - 18, - 19, + 14, + 15, ], "type": "Identifier", }, ], - "name": "M", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/decorator-on-variable.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 19, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 14, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { "$ref": 2, }, @@ -47824,7 +43630,7 @@ Object { exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -47834,7 +43640,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -47844,7 +43650,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -47859,11 +43665,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -47874,58 +43680,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -47936,7 +43697,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48064,7 +43825,7 @@ Object { exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48074,7 +43835,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48084,7 +43845,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48099,11 +43860,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48114,58 +43875,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -48176,7 +43892,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48184,7 +43900,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48194,7 +43910,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48204,7 +43920,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48219,11 +43935,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48234,58 +43950,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -48296,7 +43967,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48304,7 +43975,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48314,7 +43985,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48324,7 +43995,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48339,11 +44010,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48354,58 +44025,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "d": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "d", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "TSInterfaceDeclaration", - }, - "parent": null, - "type": "InterfaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "d", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - ], - "name": "d", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -48416,7 +44042,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48424,7 +44050,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48434,7 +44060,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48444,7 +44070,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48459,11 +44085,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48474,58 +44100,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -48536,7 +44117,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48544,7 +44125,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48554,7 +44135,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48564,7 +44145,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48579,11 +44160,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48594,58 +44175,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -48656,7 +44192,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48664,7 +44200,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48674,7 +44210,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48684,7 +44220,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48699,11 +44235,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48714,58 +44250,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -48776,7 +44267,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48784,7 +44275,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48794,7 +44285,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48804,7 +44295,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48819,11 +44310,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48834,58 +44325,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -48896,7 +44342,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48904,7 +44350,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48914,7 +44360,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48924,7 +44370,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48939,11 +44385,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48954,58 +44400,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -49016,7 +44417,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -49024,7 +44425,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49034,7 +44435,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49044,7 +44445,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49057,9 +44458,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -49076,16 +44477,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -49095,63 +44496,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -49159,14 +44515,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -49174,7 +44530,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49184,7 +44540,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49194,7 +44550,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49207,9 +44563,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -49226,16 +44582,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -49245,63 +44601,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -49309,14 +44620,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -49324,7 +44635,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-protected.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49334,7 +44645,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49344,7 +44655,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49357,9 +44668,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -49376,16 +44687,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -49395,63 +44706,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 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, - }, + "$ref": 0, }, ], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -49459,14 +44725,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -49474,7 +44740,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49484,7 +44750,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49494,7 +44760,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49507,9 +44773,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -49526,16 +44792,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -49545,63 +44811,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -49609,14 +44830,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -49624,7 +44845,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-readonly.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49634,7 +44855,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49644,7 +44865,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49657,9 +44878,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -49676,16 +44897,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -49695,63 +44916,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -49759,14 +44935,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -49774,7 +44950,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49784,7 +44960,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49794,7 +44970,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49807,9 +44983,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -49826,16 +45002,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -49845,63 +45021,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -49909,14 +45040,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -49924,7 +45055,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -49934,7 +45065,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49944,7 +45075,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49957,9 +45088,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -49974,9 +45105,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "baz", @@ -49993,19 +45124,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], }, @@ -50015,66 +45146,21 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$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, - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -50082,17 +45168,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, Object { - "$ref": 2, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -50100,7 +45186,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50110,7 +45196,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50120,7 +45206,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -50135,11 +45221,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -50150,58 +45236,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -50212,7 +45253,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -50220,7 +45261,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50230,7 +45271,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50240,7 +45281,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -50255,11 +45296,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -50270,58 +45311,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -50332,7 +45328,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -50340,7 +45336,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50350,7 +45346,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50360,7 +45356,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -50370,78 +45366,33 @@ Object { }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "interface", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 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", + "isStrict": true, "references": Array [], - "scope": Object { - "$ref": 2, + "throughReferences": Array [], + "type": "interface", + "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, @@ -50452,7 +45403,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -50460,7 +45411,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50470,7 +45421,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50480,7 +45431,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -50495,11 +45446,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -50510,58 +45461,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -50572,7 +45478,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -50580,7 +45486,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-static.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50590,7 +45496,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50600,7 +45506,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -50615,11 +45521,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -50630,58 +45536,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -50692,7 +45553,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -50700,7 +45561,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-with-default-value.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50710,7 +45571,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50720,7 +45581,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -50735,11 +45596,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -50750,58 +45611,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -50812,7 +45628,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -50822,7 +45638,7 @@ exports[`typescript fixtures/errorRecovery/interface-with-no-body.src 1`] = `"'{ exports[`typescript fixtures/errorRecovery/interface-with-optional-index-signature.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50832,7 +45648,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50842,7 +45658,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -50857,11 +45673,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -50872,58 +45688,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -50934,7 +45705,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -52585,7 +47356,7 @@ Object { exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` Object { - "$id": 16, + "$id": 15, "block": Object { "range": Array [ 0, @@ -52595,7 +47366,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 15, + "$id": 14, "block": Object { "range": Array [ 0, @@ -52605,7 +47376,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 13, "block": Object { "range": Array [ 9, @@ -52757,7 +47528,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 14, + "$ref": 13, }, "variableMap": Object { "Point": Object { @@ -52765,7 +47536,7 @@ Object { }, }, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [ Object { @@ -52811,7 +47582,7 @@ Object { ], }, Object { - "$id": 13, + "$id": 12, "block": Object { "range": Array [ 156, @@ -52821,7 +47592,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 173, @@ -52836,11 +47607,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 13, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [], }, @@ -52851,58 +47622,13 @@ Object { "throughReferences": Array [], "type": "block", "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "Id": Object { - "$ref": 11, - }, + "$ref": 13, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, - "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": "InterfaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Id", - "range": Array [ - 183, - 185, - ], - "type": "Identifier", - }, - ], - "name": "Id", - "references": Array [], - "scope": Object { - "$ref": 13, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -52911,7 +47637,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 14, + "$ref": 13, }, "identifier": Object { "name": "x", @@ -52941,7 +47667,7 @@ Object { ], "type": "block", "upperScope": Object { - "$ref": 15, + "$ref": 14, }, "variableMap": Object { "B": Object { @@ -52952,7 +47678,7 @@ Object { }, }, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [ Object { @@ -52992,7 +47718,7 @@ Object { "name": "Point", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, Object { @@ -53032,7 +47758,7 @@ Object { "name": "B", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, ], @@ -53044,7 +47770,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 16, + "$ref": 15, }, "variableMap": Object { "A": Object { @@ -53055,7 +47781,7 @@ Object { }, }, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [ Object { @@ -53095,7 +47821,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 15, + "$ref": 14, }, }, Object { @@ -53145,7 +47871,7 @@ Object { }, ], "scope": Object { - "$ref": 15, + "$ref": 14, }, }, ], @@ -53159,7 +47885,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 15, }, "variables": Array [], } @@ -53217,7 +47943,7 @@ Object { exports[`typescript fixtures/types/array-type.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -53227,7 +47953,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -53237,7 +47963,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -53252,11 +47978,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -53267,58 +47993,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "variables": Array [ - Object { - "$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", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -53329,7 +48010,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -53438,7 +48119,7 @@ Object { exports[`typescript fixtures/types/conditional-infer.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -53448,7 +48129,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -53458,7 +48139,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -53471,9 +48152,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -53484,15 +48165,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "U", @@ -53507,9 +48186,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "U", @@ -53524,9 +48203,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -53534,84 +48213,36 @@ Object { 46, 47, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "type-alias", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "T", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 15, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "T", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "name": "T", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, }, ], + "type": "type-alias", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -53619,66 +48250,27 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "Element": Object { - "$ref": 0, - }, + "$ref": 6, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -53686,17 +48278,23 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 6, }, "variables": Array [], } @@ -53704,7 +48302,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` Object { - "$id": 15, + "$id": 13, "block": Object { "range": Array [ 0, @@ -53714,7 +48312,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 12, "block": Object { "range": Array [ 0, @@ -53724,7 +48322,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 11, "block": Object { "range": Array [ 0, @@ -53737,9 +48335,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -53750,15 +48348,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -53773,9 +48369,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -53790,9 +48386,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -53803,15 +48399,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 4, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -53826,9 +48420,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -53843,9 +48437,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 6, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -53856,15 +48450,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 7, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "Promise", @@ -53879,9 +48471,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 8, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -53896,9 +48488,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 9, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -53913,9 +48505,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 10, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -53926,19 +48518,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, Object { "$ref": 4, }, + Object { + "$ref": 5, + }, Object { "$ref": 6, }, @@ -53946,94 +48548,48 @@ Object { "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { - "$ref": 10, + "$ref": 9, }, Object { - "$ref": 11, + "$ref": 10, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 12, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 12, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, Object { "$ref": 4, }, + Object { + "$ref": 5, + }, Object { "$ref": 6, }, @@ -54041,81 +48597,48 @@ Object { "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { - "$ref": 10, + "$ref": 9, }, Object { - "$ref": 11, + "$ref": 10, }, ], "type": "module", "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { - "Unpacked": Object { - "$ref": 0, - }, + "$ref": 13, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 12, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Unpacked", - "range": Array [ - 5, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 126, - ], - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, Object { "$ref": 4, }, + Object { + "$ref": 5, + }, Object { "$ref": 6, }, @@ -54123,20 +48646,20 @@ Object { "$ref": 7, }, Object { - "$ref": 9, + "$ref": 8, }, Object { - "$ref": 10, + "$ref": 9, }, Object { - "$ref": 11, + "$ref": 10, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 13, }, "variables": Array [], } @@ -54144,7 +48667,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -54154,7 +48677,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -54164,7 +48687,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -54177,9 +48700,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -54190,15 +48713,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "U", @@ -54213,9 +48734,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "U", @@ -54230,9 +48751,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "U", @@ -54249,73 +48770,27 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, }, Object { - "$ref": 5, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 5, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -54323,69 +48798,27 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, }, Object { - "$ref": 5, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 6, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 63, - ], - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -54393,20 +48826,23 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, }, Object { - "$ref": 4, + "$ref": 1, }, Object { - "$ref": 5, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 6, }, "variables": Array [], } @@ -54665,7 +49101,7 @@ Object { exports[`typescript fixtures/types/constructor-generic.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -54675,7 +49111,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -54688,9 +49124,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "a", @@ -54705,9 +49141,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -54718,15 +49154,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -54737,31 +49171,32 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, + Object { + "$ref": 3, + }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { - "T": Object { - "$ref": 1, - }, "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -54807,54 +49242,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$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, + "$ref": 4, }, }, ], @@ -54864,15 +49252,21 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, + Object { + "$ref": 3, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [], } @@ -55284,7 +49678,7 @@ Object { exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -55294,7 +49688,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -55307,9 +49701,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "a", @@ -55324,9 +49718,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -55337,15 +49731,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -55356,31 +49748,32 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, + Object { + "$ref": 3, + }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { - "T": Object { - "$ref": 1, - }, "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -55426,54 +49819,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$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, + "$ref": 4, }, }, ], @@ -55483,15 +49829,21 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, + Object { + "$ref": 3, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [], } @@ -55626,7 +49978,7 @@ Object { exports[`typescript fixtures/types/function-with-array-destruction.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -55636,7 +49988,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -55646,7 +49998,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -55659,9 +50011,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "a", @@ -55678,16 +50030,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -55697,63 +50049,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -55761,14 +50068,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -55776,7 +50083,7 @@ Object { exports[`typescript fixtures/types/function-with-object-destruction.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -55786,7 +50093,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -55796,7 +50103,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -55809,9 +50116,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "a", @@ -55828,16 +50135,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -55847,63 +50154,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -55911,14 +50173,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } @@ -56180,7 +50442,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -56190,7 +50452,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -56200,7 +50462,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -56215,11 +50477,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -56230,58 +50492,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -56292,7 +50509,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -56300,7 +50517,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -56310,7 +50527,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -56320,7 +50537,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -56335,11 +50552,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -56350,58 +50567,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -56412,7 +50584,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -56420,7 +50592,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -56430,7 +50602,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -56440,7 +50612,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -56455,11 +50627,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -56470,58 +50642,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -56532,7 +50659,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -56690,7 +50817,7 @@ Object { exports[`typescript fixtures/types/intersection-type.src 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -56700,7 +50827,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -56710,7 +50837,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -56723,9 +50850,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -56736,15 +50863,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "LinkedList", @@ -56755,15 +50880,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -56774,153 +50897,76 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "T": Object { - "$ref": 1, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "LinkedList": Object { + "throughReferences": Array [ + Object { "$ref": 0, }, - }, - "variableScope": Object { - "$ref": 6, - }, - "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, - }, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], + "type": "module", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [], } @@ -57866,7 +51912,7 @@ Object { exports[`typescript fixtures/types/nested-types.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -57876,7 +51922,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -57886,7 +51932,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -57901,11 +51947,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -57916,58 +51962,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -57978,7 +51979,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -57986,7 +51987,7 @@ Object { exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -57996,7 +51997,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -58006,7 +52007,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -58021,11 +52022,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -58036,58 +52037,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -58098,7 +52054,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -59682,269 +53638,143 @@ Object { } `; -exports[`typescript fixtures/types/tuple-optional.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 45, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 44, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 44, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 44, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 44, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/tuple-rest.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 28, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 28, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/tuple-type.src 1`] = ` +exports[`typescript fixtures/types/tuple-optional.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 29, + 45, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, - 29, + 45, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSTypeAliasDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, + "$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 [], - "throughReferences": Array [], - "type": "type-alias", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, + "scope": 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/types/tuple-rest.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object { - "Foo": Object { + "x": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [ Object { @@ -59952,39 +53782,45 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "x", "range": Array [ - 5, - 8, + 4, + 28, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, 28, ], - "type": "TSTypeAliasDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "TypeAliasName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "x", "range": Array [ - 5, - 8, + 4, + 28, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 1, }, }, ], @@ -59998,7 +53834,82 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/tuple-type.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "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 [], } @@ -60658,7 +54569,7 @@ Object { exports[`typescript fixtures/types/union-type.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -60668,7 +54579,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -60678,7 +54589,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -60693,11 +54604,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -60708,58 +54619,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -60770,7 +54636,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } From fe2a7aa7e2203fcd53b61fe2aa12a8dc28e66850 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 01:52:58 +0100 Subject: [PATCH 06/12] fix(parser): make sure that overrides implements Scope --- packages/parser/src/analyze-scope.ts | 2 +- packages/parser/src/scope/scopes.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 987656363bb7..8da7f7a88347 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -204,7 +204,7 @@ class Referencer extends TSESLintScope.Referencer { this.visitDecorators(node.decorators); - if (!this.typeMode) { + if (this.typeMode) { typeReferencing(currentScope, node); } else { super.Identifier(node); diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index d8f29c695f87..4a2a03b7cdee 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -66,7 +66,7 @@ export class TypeAliasScope extends Scope { /// eslint scopes -export class GlobalScope extends TSESLintScope.GlobalScope { +export class GlobalScope extends TSESLintScope.GlobalScope implements Scope { setTypes: Map = new Map(); types: TSESLintScope.Variable[] = []; @@ -91,7 +91,9 @@ export class GlobalScope extends TSESLintScope.GlobalScope { } } -export class FunctionExpressionNameScope extends TSESLintScope.FunctionExpressionNameScope { +export class FunctionExpressionNameScope + extends TSESLintScope.FunctionExpressionNameScope + implements Scope { setTypes: Map = new Map(); types: TSESLintScope.Variable[] = []; @@ -103,7 +105,7 @@ export class FunctionExpressionNameScope extends TSESLintScope.FunctionExpressio } } -export class WithScope extends TSESLintScope.WithScope { +export class WithScope extends TSESLintScope.WithScope implements Scope { setTypes: Map = new Map(); types: TSESLintScope.Variable[] = []; @@ -115,7 +117,8 @@ export class WithScope extends TSESLintScope.WithScope { } } -export class FunctionScope extends TSESLintScope.FunctionScope { +export class FunctionScope extends TSESLintScope.FunctionScope + implements Scope { setTypes: Map = new Map(); types: TSESLintScope.Variable[] = []; From 027492493f0867468e2ff0a0fa9d433249ad8dd8 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 22:00:06 +0100 Subject: [PATCH 07/12] fix(parser): restore some scope logic --- packages/parser/src/scope/scopes.ts | 49 +- .../lib/__snapshots__/scope-analysis.ts.snap | 6062 +++++--- .../tests/lib/__snapshots__/tsx.ts.snap | 115 +- .../lib/__snapshots__/typescript.ts.snap | 12044 ++++++++++++---- 4 files changed, 13612 insertions(+), 4658 deletions(-) diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index 4a2a03b7cdee..4f7d2a930e33 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -6,20 +6,12 @@ import { import { ScopeManager } from './scope-manager'; export class Scope extends TSESLintScope.Scope { - setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + this.__defineGeneric(node.name, this.set, this.variables, node, def); } } - - /** @internal */ - __resolve(ref: TSESLintScope.Reference): boolean { - return super.__resolve(ref); - } } /** The scope class for enum. */ @@ -67,26 +59,32 @@ export class TypeAliasScope extends Scope { /// eslint scopes export class GlobalScope extends TSESLintScope.GlobalScope implements Scope { - setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + this.__defineGeneric(node.name, this.set, 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 { - super.__define(node, definition); + 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; + // Set `variable.eslintUsed` to tell ESLint that the variable is exported. + const variable = this.set.get(node.name); + if (variable) { + variable.eslintUsed = true; + } } } } @@ -94,38 +92,29 @@ export class GlobalScope extends TSESLintScope.GlobalScope implements Scope { export class FunctionExpressionNameScope extends TSESLintScope.FunctionExpressionNameScope implements Scope { - setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + this.__defineGeneric(node.name, this.set, this.variables, node, def); } } } export class WithScope extends TSESLintScope.WithScope implements Scope { - setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + this.__defineGeneric(node.name, this.set, this.variables, node, def); } } } export class FunctionScope extends TSESLintScope.FunctionScope implements Scope { - setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + this.__defineGeneric(node.name, this.set, this.variables, node, def); } } } diff --git a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap index 2cc063c09a13..fd6ccced4fe7 100644 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap @@ -370,7 +370,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-implements.ts 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -380,7 +380,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -390,7 +390,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -405,19 +405,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 5, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { - "$id": 5, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -453,7 +453,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -463,9 +463,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Component", @@ -480,9 +480,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Nullable", @@ -493,13 +493,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "SomeOther", @@ -514,9 +516,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Component2", @@ -532,34 +534,78 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 4, + "$ref": 5, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "Nullable": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { "$id": 0, + "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": 3, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -595,7 +641,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -605,24 +651,21 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 4, + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], } @@ -1481,7 +1524,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-with-type-extends-default.ts 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -1491,7 +1534,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1501,7 +1544,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 7, @@ -1516,19 +1559,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Bar": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -1564,7 +1607,7 @@ Object { "name": "Bar", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -1574,9 +1617,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "Foo", @@ -1593,24 +1636,67 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Bar": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, + "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": 5, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -1646,7 +1732,7 @@ Object { "name": "Bar", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -1657,14 +1743,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -1672,7 +1758,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` Object { - "$id": 12, + "$id": 13, "block": Object { "range": Array [ 0, @@ -1682,7 +1768,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 0, @@ -1692,7 +1778,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 35, @@ -1705,9 +1791,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 6, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -1724,9 +1810,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -1743,9 +1829,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -1762,9 +1848,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -1782,9 +1868,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 6, - }, Object { "$ref": 7, }, @@ -1794,14 +1877,17 @@ Object { Object { "$ref": 9, }, + Object { + "$ref": 10, + }, ], "type": "interface", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [], }, @@ -1810,9 +1896,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "s1", @@ -1835,9 +1921,9 @@ Object { }, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -1852,9 +1938,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "s2", @@ -1877,9 +1963,9 @@ Object { }, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -1896,17 +1982,20 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 13, }, "variableMap": Object { + "A": Object { + "$ref": 2, + }, "s1": Object { "$ref": 0, }, @@ -1915,7 +2004,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { @@ -1961,17 +2050,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 7, }, Object { - "$ref": 8, + "$ref": 9, }, ], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, Object { @@ -2017,38 +2106,78 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 7, + "$ref": 8, }, Object { - "$ref": 9, + "$ref": 10, }, ], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, + 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, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 13, }, "variables": Array [], } @@ -2056,7 +2185,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` Object { - "$id": 12, + "$id": 13, "block": Object { "range": Array [ 0, @@ -2066,7 +2195,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 0, @@ -2076,7 +2205,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 35, @@ -2089,9 +2218,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 6, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -2108,9 +2237,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -2127,9 +2256,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -2146,9 +2275,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -2166,9 +2295,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 6, - }, Object { "$ref": 7, }, @@ -2178,14 +2304,17 @@ Object { Object { "$ref": 9, }, + Object { + "$ref": 10, + }, ], "type": "type-alias", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [], }, @@ -2194,9 +2323,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "s1", @@ -2219,9 +2348,9 @@ Object { }, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -2236,9 +2365,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "s2", @@ -2261,9 +2390,9 @@ Object { }, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -2280,17 +2409,20 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 13, }, "variableMap": Object { + "A": Object { + "$ref": 2, + }, "s1": Object { "$ref": 0, }, @@ -2299,7 +2431,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { @@ -2345,17 +2477,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 7, }, Object { - "$ref": 8, + "$ref": 9, }, ], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, Object { @@ -2401,17 +2533,57 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 7, + "$ref": 8, }, Object { - "$ref": 9, + "$ref": 10, }, ], "scope": Object { - "$ref": 11, + "$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, }, }, ], @@ -2422,17 +2594,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 13, }, "variables": Array [], } @@ -2629,7 +2801,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -2639,7 +2811,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -2649,7 +2821,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -2662,9 +2834,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Map", @@ -2679,9 +2851,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Key", @@ -2692,13 +2864,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Value", @@ -2709,13 +2883,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "subject", @@ -2727,33 +2903,33 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 3, }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, ], "type": "empty-function", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "subject": Object { + "Key": Object { "$ref": 1, }, + "Value": Object { + "$ref": 2, + }, + "subject": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -2761,65 +2937,147 @@ Object { "defs": Array [ Object { "name": Object { - "name": "subject", + "name": "Key", "range": Array [ - 27, - 51, + 15, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 69, + 14, + 26, ], - "type": "TSDeclareFunction", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "Parameter", + "type": "TypeParameter", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "subject", + "name": "Key", "range": Array [ - 27, - 51, + 15, + 18, ], "type": "Identifier", }, ], - "name": "subject", + "name": "Key", "references": Array [ Object { "$ref": 5, }, ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], - "type": "module", - "upperScope": 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": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 10, }, "variableMap": Object { "eachr": Object { @@ -2827,7 +3085,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -2867,7 +3125,7 @@ Object { "name": "eachr", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -2877,12 +3135,6 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -2891,7 +3143,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -5270,7 +5522,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/empty-body-function.ts 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -5280,7 +5532,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -5290,7 +5542,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5303,9 +5555,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Map", @@ -5320,9 +5572,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Key", @@ -5333,13 +5585,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Value", @@ -5350,13 +5604,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "subject", @@ -5368,37 +5624,125 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 3, }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, ], "type": "empty-function", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "subject": Object { + "Key": Object { "$ref": 1, }, + "Value": Object { + "$ref": 2, + }, + "subject": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 7, + "$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 { @@ -5434,11 +5778,11 @@ Object { "name": "subject", "references": Array [ Object { - "$ref": 5, + "$ref": 7, }, ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -5448,19 +5792,13 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "eachr": Object { @@ -5468,7 +5806,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -5508,7 +5846,7 @@ Object { "name": "eachr", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -5518,12 +5856,6 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -5532,7 +5864,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -7724,7 +8056,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 11, + "$id": 14, "block": Object { "range": Array [ 0, @@ -7734,7 +8066,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 13, "block": Object { "range": Array [ 0, @@ -7744,7 +8076,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -7759,16 +8091,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 10, + "$ref": 13, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 13, }, "variables": Array [], }, Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 16, @@ -7781,9 +8113,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 4, + "$ref": 7, }, "identifier": Object { "name": "A", @@ -7794,27 +8126,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "type": "interface", "upperScope": Object { - "$ref": 10, + "$ref": 13, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 13, }, "variables": Array [], }, Object { - "$id": 9, + "$id": 12, "block": Object { "range": Array [ 45, @@ -7827,9 +8161,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 8, "from": Object { - "$ref": 9, + "$ref": 12, }, "identifier": Object { "name": "B", @@ -7840,13 +8174,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 9, "from": Object { - "$ref": 9, + "$ref": 12, }, "identifier": Object { "name": "a", @@ -7858,14 +8194,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 3, }, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 9, + "$ref": 12, }, "identifier": Object { "name": "A", @@ -7876,13 +8212,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 11, "from": Object { - "$ref": 9, + "$ref": 12, }, "identifier": Object { "name": "A", @@ -7893,31 +8231,33 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 8, }, Object { - "$ref": 6, + "$ref": 9, }, Object { - "$ref": 7, + "$ref": 10, }, Object { - "$ref": 8, + "$ref": 11, }, ], "type": "interface", "upperScope": Object { - "$ref": 10, + "$ref": 13, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 13, }, "variables": Array [], }, @@ -7926,9 +8266,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 10, + "$ref": 13, }, "identifier": Object { "name": "C", @@ -7939,38 +8279,33 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 11, + "$ref": 14, }, "variableMap": Object { - "a": Object { + "A": Object { "$ref": 0, }, + "B": Object { + "$ref": 1, + }, + "C": Object { + "$ref": 2, + }, + "a": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 10, + "$ref": 13, }, "variables": Array [ Object { @@ -7978,169 +8313,291 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "A", "range": Array [ - 110, - 114, + 5, + 6, ], "type": "Identifier", }, "node": Object { "range": Array [ - 110, - 114, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 114, + 0, + 15, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "A", "range": Array [ - 110, - 114, + 5, + 6, ], "type": "Identifier", }, ], - "name": "a", + "name": "A", "references": Array [ Object { "$ref": 6, }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, ], "scope": Object { - "$ref": 10, + "$ref": 13, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "B", "range": Array [ - 7, - 10, + 26, + 27, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 27, + 16, + 44, ], - "type": "TSImportEqualsDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "ImportBinding", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "B", "range": Array [ - 7, - 10, + 26, + 27, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [], + "name": "B", + "references": Array [ + Object { + "$ref": 8, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 13, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], + 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 [ + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSImportEqualsDeclaration", + }, + "parent": null, + "type": "ImportBinding", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -8203,7 +8660,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/interface-type.ts 1`] = ` Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -8213,7 +8670,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -8223,7 +8680,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -8238,16 +8695,16 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], }, Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 27, @@ -8260,9 +8717,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 3, + "$ref": 6, }, "identifier": Object { "name": "C", @@ -8273,22 +8730,24 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 5, }, ], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], }, @@ -8297,9 +8756,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 7, }, "identifier": Object { "name": "C", @@ -8310,45 +8769,198 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 0, + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "C": Object { + "$ref": 1, }, - Object { + "R": Object { "$ref": 2, }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, + "T": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 2, + "variables": Array [ + Object { + "$id": 0, + "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", + }, + 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 [ + 12, + 13, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 2, + "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": 7, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [], } @@ -9708,7 +10320,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -9718,7 +10330,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -9728,7 +10340,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -9743,11 +10355,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -9758,13 +10370,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -9775,7 +10432,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -9783,7 +10440,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` Object { - "$id": 12, + "$id": 13, "block": Object { "range": Array [ 0, @@ -9793,7 +10450,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 0, @@ -9803,7 +10460,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -9818,16 +10475,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [], }, Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 32, @@ -9837,7 +10494,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 47, @@ -9850,9 +10507,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 9, + "$ref": 10, }, "identifier": Object { "name": "A", @@ -9863,13 +10520,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 9, + "$ref": 10, }, "identifier": Object { "name": "A", @@ -9880,47 +10539,49 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 7, + "$ref": 8, }, Object { - "$ref": 8, + "$ref": 9, }, ], "type": "function", "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "a": Object { - "$ref": 6, + "$ref": 7, }, "arguments": Object { - "$ref": 5, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { - "$id": 5, + "$id": 6, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, Object { - "$id": 6, + "$id": 7, "defs": Array [ Object { "name": Object { @@ -9956,7 +10617,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -9967,27 +10628,27 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 7, + "$ref": 8, }, Object { - "$ref": 8, + "$ref": 9, }, ], "type": "class", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object { "C": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { - "$id": 4, + "$id": 5, "defs": Array [ Object { "name": Object { @@ -10023,7 +10684,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 11, }, }, ], @@ -10033,9 +10694,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "A", @@ -10046,39 +10707,84 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 13, }, "variableMap": Object { + "A": Object { + "$ref": 0, + }, "C": Object { - "$ref": 1, + "$ref": 2, }, "a": Object { - "$ref": 0, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 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 [ + Object { + "$ref": 3, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -10120,11 +10826,11 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -10160,7 +10866,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, ], @@ -10169,22 +10875,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 13, }, "variables": Array [], } @@ -10192,7 +10888,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -10202,7 +10898,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -10212,7 +10908,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -10227,11 +10923,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], }, @@ -10240,9 +10936,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "a", @@ -10263,9 +10959,9 @@ Object { }, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "A", @@ -10276,13 +10972,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "b", @@ -10297,9 +10995,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "a", @@ -10320,9 +11018,9 @@ Object { }, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "b", @@ -10337,9 +11035,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "A", @@ -10350,20 +11048,16 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, @@ -10376,28 +11070,74 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 9, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, - "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, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, @@ -10412,7 +11152,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], } @@ -10420,7 +11160,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -10430,7 +11170,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -10440,7 +11180,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -10455,15 +11195,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -10474,27 +11217,67 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + Object { + "$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", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -10534,7 +11317,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -10548,7 +11331,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -10878,7 +11661,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof.ts 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -10888,7 +11671,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -10898,7 +11681,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 23, @@ -10911,9 +11694,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 4, }, "identifier": Object { "name": "obj", @@ -10932,16 +11715,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], }, @@ -10950,9 +11733,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "obj", @@ -10978,15 +11761,18 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { + "B": Object { + "$ref": 1, + }, "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -11032,14 +11818,54 @@ Object { "name": "obj", "references": Array [ Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 3, }, ], "scope": Object { - "$ref": 4, + "$ref": 5, + }, + }, + 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, }, }, ], @@ -11053,7 +11879,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -11342,7 +12168,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` Object { - "$id": 16, + "$id": 18, "block": Object { "range": Array [ 0, @@ -11352,7 +12178,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 15, + "$id": 17, "block": Object { "range": Array [ 0, @@ -11362,7 +12188,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 16, "block": Object { "range": Array [ 25, @@ -11375,9 +12201,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -11394,9 +12220,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -11411,9 +12237,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -11430,9 +12256,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -11447,9 +12273,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 8, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "T", @@ -11460,13 +12286,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 3, + }, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -11483,9 +12311,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -11502,9 +12330,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 11, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -11519,9 +12347,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 12, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -11538,9 +12366,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 13, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -11555,9 +12383,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 14, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "T", @@ -11568,13 +12396,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 3, + }, "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 15, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -11592,12 +12422,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -11610,9 +12434,6 @@ Object { Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, @@ -11628,78 +12449,157 @@ Object { Object { "$ref": 13, }, + Object { + "$ref": 15, + }, ], "type": "interface", "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 15, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 15, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", + "$ref": 17, }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "variableMap": Object { + "T": Object { + "$ref": 3, + }, }, - "writeExpr": Object { - "range": Array [ - 12, - 24, - ], - "type": "ObjectExpression", + "variableScope": Object { + "$ref": 17, }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 11, - }, - Object { - "$ref": 12, - }, + "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": true, + "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", "upperScope": Object { - "$ref": 16, + "$ref": 18, }, "variableMap": Object { + "A": Object { + "$ref": 1, + }, "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 15, + "$ref": 17, }, "variables": Array [ Object { @@ -11744,9 +12644,6 @@ Object { ], "name": "obj", "references": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -11754,20 +12651,63 @@ Object { "$ref": 4, }, Object { - "$ref": 7, + "$ref": 6, }, Object { - "$ref": 8, + "$ref": 9, }, Object { "$ref": 10, }, Object { - "$ref": 13, + "$ref": 12, + }, + Object { + "$ref": 15, }, ], "scope": Object { - "$ref": 15, + "$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, }, }, ], @@ -11777,30 +12717,24 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 5, }, Object { - "$ref": 6, - }, - Object { - "$ref": 9, + "$ref": 7, }, Object { "$ref": 11, }, Object { - "$ref": 12, + "$ref": 13, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 18, }, "variables": Array [], } @@ -12011,7 +12945,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -12021,7 +12955,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -12031,7 +12965,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -12044,9 +12978,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "g", @@ -12058,14 +12992,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -12076,29 +13010,30 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, "g": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -12109,11 +13044,55 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$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 { @@ -12149,11 +13128,11 @@ Object { "name": "g", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -12162,14 +13141,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "g": Object { @@ -12177,7 +13152,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -12217,7 +13192,7 @@ Object { "name": "g", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -12226,16 +13201,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } @@ -12674,7 +13645,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -12684,7 +13655,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -12694,7 +13665,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -12709,11 +13680,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -12724,13 +13695,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, + 19, + ], + "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, @@ -12741,7 +13757,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -13101,7 +14117,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-infer.ts 1`] = ` Object { - "$id": 13, + "$id": 15, "block": Object { "range": Array [ 0, @@ -13111,7 +14127,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, @@ -13121,7 +14137,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, @@ -13134,9 +14150,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -13147,13 +14163,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -13168,9 +14186,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -13185,9 +14203,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -13198,13 +14216,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -13219,9 +14239,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -13236,9 +14256,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 8, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -13249,13 +14269,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "Promise", @@ -13270,9 +14292,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -13287,9 +14309,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 11, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -13304,9 +14326,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 12, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -13317,148 +14339,217 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, Object { "$ref": 4, }, - Object { - "$ref": 5, - }, Object { "$ref": 6, }, Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, Object { "$ref": 10, }, + Object { + "$ref": 11, + }, ], "type": "type-alias", "upperScope": Object { - "$ref": 12, + "$ref": 14, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, - "variables": Array [], + "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": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, Object { "$ref": 4, }, - Object { - "$ref": 5, - }, Object { "$ref": 6, }, Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, Object { "$ref": 10, }, + Object { + "$ref": 11, + }, ], "type": "module", "upperScope": Object { - "$ref": 13, + "$ref": 15, + }, + "variableMap": Object { + "Unpacked": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, + "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, }, Object { "$ref": 4, }, - Object { - "$ref": 5, - }, Object { "$ref": 6, }, Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, Object { "$ref": 10, }, + Object { + "$ref": 11, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 15, }, "variables": Array [], } @@ -13466,7 +14557,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -13476,7 +14567,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -13486,7 +14577,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -13499,9 +14590,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -13512,13 +14603,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "LinkedList", @@ -13529,13 +14622,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -13546,76 +14641,153 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, + "$ref": 3, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, - "variables": Array [], + "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 [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 7, + }, + "variableMap": Object { + "LinkedList": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$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, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [], } @@ -14131,7 +15303,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14141,7 +15313,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -14151,7 +15323,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -14166,11 +15338,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -14181,32 +15353,77 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$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, + "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-parenthesized-type.src.ts 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14216,7 +15433,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -14226,7 +15443,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -14241,11 +15458,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -14256,13 +15473,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -14273,7 +15535,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -15089,7 +16351,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15099,7 +16361,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15109,7 +16371,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -15124,11 +16386,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -15139,13 +16401,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -15156,7 +16463,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -15816,7 +17123,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15826,7 +17133,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15836,7 +17143,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -15851,11 +17158,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -15866,13 +17173,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -15883,7 +17235,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -16209,7 +17561,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-implements.ts 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -16219,7 +17571,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16234,19 +17586,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 5, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { - "$id": 5, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -16282,7 +17634,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -16292,9 +17644,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Component", @@ -16309,9 +17661,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Nullable", @@ -16322,13 +17674,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "SomeOther", @@ -16343,9 +17697,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Component2", @@ -16361,32 +17715,76 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 4, + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "Nullable": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { "$id": 0, + "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": true, + "identifiers": Array [ + Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Nullable", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -16422,7 +17820,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -17209,7 +18607,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-with-type-extends-default.ts 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -17219,7 +18617,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 7, @@ -17234,19 +18632,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Bar": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -17282,7 +18680,7 @@ Object { "name": "Bar", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -17292,9 +18690,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "Foo", @@ -17311,22 +18709,65 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object { "Bar": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, + "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": true, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -17362,7 +18803,7 @@ Object { "name": "Bar", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -17371,7 +18812,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 0, @@ -17381,7 +18822,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 35, @@ -17394,9 +18835,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 6, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -17413,9 +18854,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -17432,9 +18873,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -17451,9 +18892,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -17471,9 +18912,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 6, - }, Object { "$ref": 7, }, @@ -17483,14 +18921,17 @@ Object { Object { "$ref": 9, }, + Object { + "$ref": 10, + }, ], "type": "interface", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [], }, @@ -17499,9 +18940,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "s1", @@ -17524,9 +18965,9 @@ Object { }, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -17541,9 +18982,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "s2", @@ -17566,9 +19007,9 @@ Object { }, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -17585,15 +19026,18 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "global", "upperScope": null, "variableMap": Object { + "A": Object { + "$ref": 2, + }, "s1": Object { "$ref": 0, }, @@ -17602,7 +19046,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { @@ -17648,17 +19092,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 7, }, Object { - "$ref": 8, + "$ref": 9, }, ], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, Object { @@ -17704,17 +19148,57 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 7, + "$ref": 8, }, Object { - "$ref": 9, + "$ref": 10, }, ], "scope": Object { - "$ref": 11, + "$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": true, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, }, }, ], @@ -17723,7 +19207,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 0, @@ -17733,7 +19217,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 35, @@ -17746,9 +19230,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 6, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -17765,9 +19249,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -17784,9 +19268,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s1", @@ -17803,9 +19287,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 10, + "$ref": 11, }, "identifier": Object { "name": "s2", @@ -17823,9 +19307,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 6, - }, Object { "$ref": 7, }, @@ -17835,14 +19316,17 @@ Object { Object { "$ref": 9, }, + Object { + "$ref": 10, + }, ], "type": "type-alias", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [], }, @@ -17851,9 +19335,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "s1", @@ -17876,9 +19360,9 @@ Object { }, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -17893,9 +19377,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "s2", @@ -17918,9 +19402,9 @@ Object { }, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "Symbol", @@ -17937,15 +19421,18 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "global", "upperScope": null, "variableMap": Object { + "A": Object { + "$ref": 2, + }, "s1": Object { "$ref": 0, }, @@ -17954,7 +19441,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { @@ -18000,17 +19487,17 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 6, + "$ref": 7, }, Object { - "$ref": 8, + "$ref": 9, }, ], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, Object { @@ -18056,17 +19543,57 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 7, + "$ref": 8, }, Object { - "$ref": 9, + "$ref": 10, }, ], "scope": Object { - "$ref": 11, + "$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": true, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, }, }, ], @@ -18239,7 +19766,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -18249,7 +19776,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -18262,9 +19789,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Map", @@ -18279,9 +19806,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Key", @@ -18292,13 +19819,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Value", @@ -18309,13 +19838,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "subject", @@ -18327,37 +19858,125 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 3, }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, ], "type": "empty-function", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "subject": Object { + "Key": Object { "$ref": 1, }, + "Value": Object { + "$ref": 2, + }, + "subject": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 7, + "$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 { @@ -18393,11 +20012,11 @@ Object { "name": "subject", "references": Array [ Object { - "$ref": 5, + "$ref": 7, }, ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -18407,12 +20026,6 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -18425,7 +20038,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -18465,7 +20078,7 @@ Object { "name": "eachr", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -20621,7 +22234,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/empty-body-function.ts 1`] = ` Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -20631,7 +22244,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -20644,9 +22257,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Map", @@ -20661,9 +22274,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Key", @@ -20674,13 +22287,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "Value", @@ -20691,13 +22306,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { "name": "subject", @@ -20709,37 +22326,125 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 3, }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, ], "type": "empty-function", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "subject": Object { + "Key": Object { "$ref": 1, }, + "Value": Object { + "$ref": 2, + }, + "subject": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 7, + "$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 { @@ -20775,11 +22480,11 @@ Object { "name": "subject", "references": Array [ Object { - "$ref": 5, + "$ref": 7, }, ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -20789,12 +22494,6 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -20807,7 +22506,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -20847,7 +22546,7 @@ Object { "name": "eachr", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -22815,7 +24514,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 10, + "$id": 13, "block": Object { "range": Array [ 0, @@ -22825,7 +24524,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -22840,16 +24539,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 10, + "$ref": 13, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 13, }, "variables": Array [], }, Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 16, @@ -22862,9 +24561,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 4, + "$ref": 7, }, "identifier": Object { "name": "A", @@ -22875,27 +24574,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "type": "interface", "upperScope": Object { - "$ref": 10, + "$ref": 13, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 13, }, "variables": Array [], }, Object { - "$id": 9, + "$id": 12, "block": Object { "range": Array [ 45, @@ -22908,9 +24609,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 5, + "$id": 8, "from": Object { - "$ref": 9, + "$ref": 12, }, "identifier": Object { "name": "B", @@ -22921,13 +24622,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 9, "from": Object { - "$ref": 9, + "$ref": 12, }, "identifier": Object { "name": "a", @@ -22939,14 +24642,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 3, }, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 9, + "$ref": 12, }, "identifier": Object { "name": "A", @@ -22957,13 +24660,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 11, "from": Object { - "$ref": 9, + "$ref": 12, }, "identifier": Object { "name": "A", @@ -22974,31 +24679,33 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 8, }, Object { - "$ref": 6, + "$ref": 9, }, Object { - "$ref": 7, + "$ref": 10, }, Object { - "$ref": 8, + "$ref": 11, }, ], "type": "interface", "upperScope": Object { - "$ref": 10, + "$ref": 13, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 13, }, "variables": Array [], }, @@ -23007,9 +24714,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 10, + "$ref": 13, }, "identifier": Object { "name": "C", @@ -23020,36 +24727,31 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { - "a": Object { + "A": Object { "$ref": 0, }, + "B": Object { + "$ref": 1, + }, + "C": Object { + "$ref": 2, + }, + "a": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 10, + "$ref": 13, }, "variables": Array [ Object { @@ -23057,49 +24759,187 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "A", "range": Array [ - 110, - 114, + 5, + 6, ], "type": "Identifier", }, "node": Object { "range": Array [ - 110, - 114, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 114, + 0, + 15, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "A", "range": Array [ - 110, - 114, + 5, + 6, ], "type": "Identifier", }, ], - "name": "a", + "name": "A", "references": Array [ Object { "$ref": 6, }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, ], "scope": Object { - "$ref": 10, + "$ref": 13, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 44, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [ + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$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": true, + "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": true, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 110, + 114, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 13, }, }, ], @@ -23203,7 +25043,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/interface-type.ts 1`] = ` Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -23213,7 +25053,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -23228,16 +25068,16 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], }, Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 27, @@ -23250,9 +25090,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 3, + "$ref": 6, }, "identifier": Object { "name": "C", @@ -23263,22 +25103,24 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 5, }, ], "type": "interface", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], }, @@ -23287,9 +25129,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 0, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 7, }, "identifier": Object { "name": "C", @@ -23300,82 +25142,242 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 0, + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "C": Object { + "$ref": 1, }, - Object { + "R": Object { "$ref": 2, }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, + "T": Object { + "$ref": 0, + }, }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 143, - ], - "type": "Program", + "variableScope": Object { + "$ref": 7, }, - "childScopes": Array [ + "variables": Array [ Object { - "$id": 5, - "block": Object { - "range": Array [ - 28, - 142, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "text", + "name": Object { + "name": "T", "range": Array [ - 116, - 120, + 12, + 13, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "node": Object { + "range": Array [ + 11, + 20, + ], + "type": "TSTypeParameterDeclaration", }, - "writeExpr": undefined, + "parent": null, + "type": "TypeParameter", }, - ], - "throughReferences": Array [ Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "name": Object { + "name": "T", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 38, + 51, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 2, + "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": true, + "identifiers": Array [ + Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + ], + "name": "R", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 143, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 28, + 142, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "text", + "range": Array [ + 116, + 120, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { "arguments": Object { "$ref": 3, }, @@ -24540,7 +26542,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24550,7 +26552,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24565,11 +26567,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -24580,17 +26582,62 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 1, + "$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": true, + "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/type-annotations.ts 1`] = ` Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 0, @@ -24600,7 +26647,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -24615,16 +26662,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [], }, Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 32, @@ -24634,7 +26681,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 47, @@ -24647,9 +26694,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 9, + "$ref": 10, }, "identifier": Object { "name": "A", @@ -24660,13 +26707,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 9, + "$ref": 10, }, "identifier": Object { "name": "A", @@ -24677,47 +26726,49 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 7, + "$ref": 8, }, Object { - "$ref": 8, + "$ref": 9, }, ], "type": "function", "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "a": Object { - "$ref": 6, + "$ref": 7, }, "arguments": Object { - "$ref": 5, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { - "$id": 5, + "$id": 6, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, Object { - "$id": 6, + "$id": 7, "defs": Array [ Object { "name": Object { @@ -24753,7 +26804,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -24764,27 +26815,27 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 7, + "$ref": 8, }, Object { - "$ref": 8, + "$ref": 9, }, ], "type": "class", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object { "C": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { - "$id": 4, + "$id": 5, "defs": Array [ Object { "name": Object { @@ -24820,7 +26871,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 11, }, }, ], @@ -24830,9 +26881,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "A", @@ -24843,37 +26894,82 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { + "A": Object { + "$ref": 0, + }, "C": Object { - "$ref": 1, + "$ref": 2, }, "a": Object { - "$ref": 0, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -24915,11 +27011,11 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -24955,7 +27051,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, ], @@ -24964,7 +27060,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -24974,7 +27070,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -24989,11 +27085,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], }, @@ -25002,9 +27098,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "a", @@ -25025,9 +27121,9 @@ Object { }, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "A", @@ -25038,13 +27134,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "b", @@ -25059,9 +27157,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "a", @@ -25082,9 +27180,9 @@ Object { }, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "b", @@ -25099,9 +27197,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "A", @@ -25112,20 +27210,16 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, @@ -25138,17 +27232,69 @@ Object { ], "type": "global", "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, - "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, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -25158,7 +27304,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25173,15 +27319,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -25192,25 +27341,65 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { + Object { + "$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", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -25250,7 +27439,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -25523,7 +27712,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof.ts 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -25533,7 +27722,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 23, @@ -25546,9 +27735,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 4, }, "identifier": Object { "name": "obj", @@ -25567,16 +27756,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], }, @@ -25585,9 +27774,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "obj", @@ -25614,12 +27803,15 @@ Object { "type": "global", "upperScope": null, "variableMap": Object { + "B": Object { + "$ref": 1, + }, "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -25665,14 +27857,54 @@ Object { "name": "obj", "references": Array [ Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 3, }, ], "scope": Object { - "$ref": 4, + "$ref": 5, + }, + }, + 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": true, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [], + "scope": Object { + "$ref": 5, }, }, ], @@ -25924,7 +28156,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` Object { - "$id": 15, + "$id": 17, "block": Object { "range": Array [ 0, @@ -25934,7 +28166,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 16, "block": Object { "range": Array [ 25, @@ -25947,9 +28179,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -25966,9 +28198,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -25983,9 +28215,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -26002,9 +28234,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -26019,9 +28251,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 8, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "T", @@ -26032,13 +28264,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 3, + }, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -26055,9 +28289,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -26074,9 +28308,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 11, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -26091,9 +28325,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 12, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -26110,9 +28344,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 13, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -26127,9 +28361,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 14, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "T", @@ -26140,13 +28374,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 3, + }, "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 15, "from": Object { - "$ref": 14, + "$ref": 16, }, "identifier": Object { "name": "obj", @@ -26164,12 +28400,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -26182,9 +28412,6 @@ Object { Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, @@ -26200,76 +28427,155 @@ Object { Object { "$ref": 13, }, + Object { + "$ref": 15, + }, ], "type": "interface", "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 15, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 15, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", + "$ref": 17, }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "variableMap": Object { + "T": Object { + "$ref": 3, + }, }, - "writeExpr": Object { - "range": Array [ - 12, - 24, - ], - "type": "ObjectExpression", + "variableScope": Object { + "$ref": 17, }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 11, - }, - Object { - "$ref": 12, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 15, + "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": 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": "global", + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + "obj": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 17, }, "variables": Array [ Object { @@ -26314,9 +28620,6 @@ Object { ], "name": "obj", "references": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -26324,20 +28627,63 @@ Object { "$ref": 4, }, Object { - "$ref": 7, + "$ref": 6, }, Object { - "$ref": 8, + "$ref": 9, }, Object { "$ref": 10, }, Object { - "$ref": 13, + "$ref": 12, + }, + Object { + "$ref": 15, }, ], "scope": Object { - "$ref": 15, + "$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": true, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 17, }, }, ], @@ -26524,7 +28870,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -26534,7 +28880,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -26547,9 +28893,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "g", @@ -26561,14 +28907,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -26579,29 +28925,30 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, "g": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -26612,11 +28959,55 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$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 { @@ -26652,11 +29043,11 @@ Object { "name": "g", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -26665,11 +29056,7 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object { @@ -26678,7 +29065,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -26718,7 +29105,7 @@ Object { "name": "g", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -27133,7 +29520,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -27143,7 +29530,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -27158,11 +29545,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -27173,11 +29560,56 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 1, + "$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, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; @@ -27453,7 +29885,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-infer.ts 1`] = ` Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, @@ -27463,7 +29895,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, @@ -27476,9 +29908,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -27489,13 +29921,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -27510,9 +29944,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -27527,9 +29961,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -27540,13 +29974,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -27561,9 +29997,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -27578,9 +30014,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 8, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -27591,13 +30027,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "Promise", @@ -27612,9 +30050,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -27629,9 +30067,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 11, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -27646,9 +30084,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 12, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -27659,107 +30097,188 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, Object { "$ref": 4, }, - Object { - "$ref": 5, - }, Object { "$ref": 6, }, Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, Object { "$ref": 10, }, + Object { + "$ref": 11, + }, ], "type": "type-alias", "upperScope": Object { - "$ref": 12, + "$ref": 14, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, - "variables": Array [], + "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": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, Object { "$ref": 4, }, - Object { - "$ref": 5, - }, Object { "$ref": 6, }, Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, Object { "$ref": 10, }, + Object { + "$ref": 11, + }, ], "type": "global", "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "Unpacked": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, - "variables": Array [], + "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": true, + "identifiers": Array [ + Object { + "name": "Unpacked", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Unpacked", + "references": Array [], + "scope": Object { + "$ref": 14, + }, + }, + ], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -27769,7 +30288,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -27782,9 +30301,9 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -27795,13 +30314,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "LinkedList", @@ -27812,13 +30333,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -27829,53 +30352,140 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, + "$ref": 3, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$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": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object { + "LinkedList": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "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": true, + "identifiers": Array [ + Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + ], + "name": "LinkedList", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 6, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, }, ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], } `; @@ -28273,7 +30883,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28283,7 +30893,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28298,11 +30908,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -28313,17 +30923,62 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 1, + "$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": true, + "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": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28333,7 +30988,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28348,11 +31003,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -28363,11 +31018,56 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 1, + "$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": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; @@ -28991,7 +31691,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29001,7 +31701,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -29016,11 +31716,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -29031,11 +31731,56 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 1, + "$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": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; @@ -29585,7 +32330,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29595,7 +32340,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -29610,11 +32355,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -29625,10 +32370,55 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 1, + "$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": true, + "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 98a3720fdb4a..eade98ea309d 100644 --- a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap @@ -102,7 +102,7 @@ Object { exports[`TSX fixtures/react-typed-props.src 1`] = ` Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -112,7 +112,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -122,7 +122,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 31, @@ -137,16 +137,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], }, Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 80, @@ -159,9 +159,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Props", @@ -172,13 +172,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 7, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "props", @@ -190,45 +192,45 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 4, + "$ref": 5, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 6, }, ], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { - "$ref": 3, + "$ref": 4, }, "props": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { - "$id": 3, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { - "$id": 4, + "$id": 5, "defs": Array [ Object { "name": Object { @@ -264,11 +266,11 @@ Object { "name": "props", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -277,17 +279,16 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "App": Object { + "$ref": 2, + }, + "Props": Object { "$ref": 1, }, "React": Object { @@ -295,7 +296,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -341,11 +342,55 @@ Object { "name": "React", "references": Array [], "scope": Object { - "$ref": 8, + "$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 { @@ -381,7 +426,7 @@ Object { "name": "App", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -390,16 +435,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$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 6665e7932ebc..65fe153afbb5 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, @@ -37,15 +37,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -56,7 +59,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, }, }, ], @@ -68,7 +111,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -76,7 +119,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -116,7 +159,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -130,7 +173,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -138,7 +181,7 @@ Object { exports[`typescript fixtures/babylon-convergence/type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -148,7 +191,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -158,7 +201,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -173,15 +216,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -192,7 +238,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, }, }, ], @@ -204,7 +290,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -212,7 +298,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -252,7 +338,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -266,7 +352,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -1489,7 +1575,7 @@ Object { exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -1499,7 +1585,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -1509,7 +1595,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 7, @@ -1524,11 +1610,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -1539,13 +1625,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "I": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -1556,7 +1687,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -2064,7 +2195,7 @@ Object { exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -2074,7 +2205,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -2084,7 +2215,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2097,9 +2228,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "X", @@ -2110,13 +2241,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "X", @@ -2127,13 +2260,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "b", @@ -2145,34 +2280,77 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 1, }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { - "b": Object { + "X": Object { "$ref": 0, }, + "b": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 4, + "$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 { @@ -2208,11 +2386,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -2221,21 +2399,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], }, @@ -2243,19 +2414,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -3061,7 +3225,7 @@ Object { exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -3071,7 +3235,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -3081,7 +3245,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -3094,9 +3258,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "a", @@ -3111,9 +3275,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "a", @@ -3130,19 +3294,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], }, @@ -3152,21 +3316,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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, @@ -3174,17 +3383,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -3192,7 +3401,7 @@ Object { exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -3202,7 +3411,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -3212,7 +3421,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -3225,9 +3434,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 4, }, "identifier": Object { "name": "a", @@ -3242,9 +3451,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 2, + "$ref": 4, }, "identifier": Object { "name": "a", @@ -3261,26 +3470,242 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, }, Object { - "$ref": 1, + "$ref": 3, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 3, + "$ref": 5, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, - "variables": Array [], + "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 [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 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 [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "y", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], "throughReferences": Array [ Object { "$ref": 0, @@ -3291,11 +3716,11 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -3315,19 +3740,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` +exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 18, + 15, ], "type": "Program", }, @@ -3337,106 +3762,7 @@ Object { "block": Object { "range": Array [ 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, + 15, ], "type": "Program", }, @@ -5016,7 +5342,7 @@ Object { exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -5026,7 +5352,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -5036,7 +5362,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5046,7 +5372,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 23, @@ -5061,15 +5387,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -5080,13 +5409,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, @@ -5101,26 +5470,69 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { + "T": Object { + "$ref": 6, + }, "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, }, }, ], @@ -5132,7 +5544,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "C": Object { @@ -5140,7 +5552,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -5180,7 +5592,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -5192,7 +5604,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -5200,7 +5612,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -5240,7 +5652,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -5254,7 +5666,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -6055,7 +6467,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6065,7 +6477,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6075,7 +6487,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6090,19 +6502,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Foo": Object { - "$ref": 3, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { - "$id": 3, + "$id": 4, "defs": Array [ Object { "name": Object { @@ -6138,7 +6550,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -6148,9 +6560,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "B", @@ -6165,9 +6577,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "Bar", @@ -6184,27 +6596,70 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "A": Object { "$ref": 0, }, + "Foo": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { "$id": 0, + "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": 6, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -6240,7 +6695,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -6251,17 +6706,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -6269,7 +6724,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -6279,7 +6734,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -6289,7 +6744,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6304,19 +6759,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 5, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { - "$id": 5, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -6352,7 +6807,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -6362,9 +6817,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "B", @@ -6379,9 +6834,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "C", @@ -6396,9 +6851,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "D", @@ -6413,9 +6868,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Bar", @@ -6431,9 +6886,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -6443,22 +6895,68 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { - "Foo": Object { + "A": Object { "$ref": 0, }, + "Foo": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { "$id": 0, + "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": 8, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -6494,7 +6992,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -6504,9 +7002,6 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -6516,12 +7011,15 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], } @@ -6529,7 +7027,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6539,7 +7037,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6549,7 +7047,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6559,7 +7057,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 20, @@ -6574,15 +7072,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -6593,7 +7094,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, }, }, ], @@ -6605,7 +7146,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -6613,7 +7154,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -6653,7 +7194,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -6665,7 +7206,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6673,7 +7214,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -6713,7 +7254,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -6727,7 +7268,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -6735,7 +7276,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -6745,7 +7286,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6755,7 +7296,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6765,7 +7306,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 20, @@ -6778,9 +7319,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "Bar", @@ -6797,20 +7338,23 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -6821,7 +7365,47 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$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, }, }, ], @@ -6832,12 +7416,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6845,7 +7429,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -6885,7 +7469,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -6896,12 +7480,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -6909,7 +7493,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -6949,7 +7533,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -6960,14 +7544,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } @@ -7831,7 +8415,7 @@ Object { exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -7841,7 +8425,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -7851,7 +8435,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -7876,7 +8460,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -7901,7 +8485,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 35, @@ -7916,15 +8500,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { + "T": Object { + "$ref": 5, + }, "arguments": Object { "$ref": 4, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -7935,13 +8522,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, @@ -7956,26 +8583,26 @@ Object { "throughReferences": Array [], "type": "function", "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, }, }, ], @@ -7987,7 +8614,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -7995,7 +8622,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -8035,7 +8662,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -8047,7 +8674,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "C": Object { @@ -8055,7 +8682,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -8095,7 +8722,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -8109,7 +8736,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -8117,7 +8744,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 22, + "$id": 26, "block": Object { "range": Array [ 0, @@ -8127,7 +8754,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 21, + "$id": 25, "block": Object { "range": Array [ 0, @@ -8137,7 +8764,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 0, @@ -8147,7 +8774,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 14, "block": Object { "range": Array [ 60, @@ -8162,11 +8789,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [], }, @@ -8175,9 +8802,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 11, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Constructor", @@ -8188,13 +8815,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 4, + }, "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 12, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "T", @@ -8205,13 +8834,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 9, + }, "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 13, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Base", @@ -8223,48 +8854,92 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 7, + "$ref": 10, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 8, - }, - Object { - "$ref": 9, + "$ref": 11, }, ], "type": "function", "upperScope": Object { - "$ref": 21, + "$ref": 25, }, "variableMap": Object { "Base": Object { - "$ref": 7, + "$ref": 10, + }, + "T": Object { + "$ref": 9, }, "arguments": Object { - "$ref": 6, + "$ref": 8, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { - "$id": 6, + "$id": 8, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, Object { - "$id": 7, + "$id": 9, + "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": 12, + }, + ], + "scope": Object { + "$ref": 15, + }, + }, + Object { + "$id": 10, "defs": Array [ Object { "name": Object { @@ -8300,17 +8975,17 @@ Object { "name": "Base", "references": Array [ Object { - "$ref": 10, + "$ref": 13, }, ], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, ], }, Object { - "$id": 14, + "$id": 17, "block": Object { "range": Array [ 86, @@ -8325,19 +9000,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 21, + "$ref": 25, }, "variableMap": Object { "X": Object { - "$ref": 13, + "$ref": 16, }, }, "variableScope": Object { - "$ref": 21, + "$ref": 25, }, "variables": Array [ Object { - "$id": 13, + "$id": 16, "defs": Array [ Object { "name": Object { @@ -8373,13 +9048,13 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 17, }, }, ], }, Object { - "$id": 16, + "$id": 19, "block": Object { "range": Array [ 130, @@ -8394,19 +9069,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 21, + "$ref": 25, }, "variableMap": Object { "C": Object { - "$ref": 15, + "$ref": 18, }, }, "variableScope": Object { - "$ref": 21, + "$ref": 25, }, "variables": Array [ Object { - "$id": 15, + "$id": 18, "defs": Array [ Object { "name": Object { @@ -8442,13 +9117,13 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 16, + "$ref": 19, }, }, ], }, Object { - "$id": 17, + "$id": 20, "block": Object { "range": Array [ 142, @@ -8463,16 +9138,16 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 21, + "$ref": 25, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 21, + "$ref": 25, }, "variables": Array [], }, Object { - "$id": 20, + "$id": 24, "block": Object { "range": Array [ 158, @@ -8485,9 +9160,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 18, + "$id": 22, "from": Object { - "$ref": 20, + "$ref": 24, }, "identifier": Object { "name": "args", @@ -8502,9 +9177,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 19, + "$id": 23, "from": Object { - "$ref": 20, + "$ref": 24, }, "identifier": Object { "name": "T", @@ -8515,36 +9190,84 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 21, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 18, - }, - Object { - "$ref": 19, + "$ref": 22, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 21, + "$ref": 25, + }, + "variableMap": Object { + "T": Object { + "$ref": 21, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 21, + "$ref": 25, }, - "variables": Array [], + "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, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 21, + "$ref": 25, }, "identifier": Object { "name": "I", @@ -8555,13 +9278,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 3, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 21, + "$ref": 25, }, "identifier": Object { "name": "M", @@ -8578,9 +9303,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 21, + "$ref": 25, }, "identifier": Object { "name": "C", @@ -8599,29 +9324,23 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 18, - }, - Object { - "$ref": 19, + "$ref": 22, }, ], "type": "module", "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "C": Object { "$ref": 2, }, + "Constructor": Object { + "$ref": 4, + }, + "I": Object { + "$ref": 3, + }, "M": Object { "$ref": 0, }, @@ -8630,7 +9349,7 @@ Object { }, }, "variableScope": Object { - "$ref": 21, + "$ref": 25, }, "variables": Array [ Object { @@ -8670,11 +9389,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 4, + "$ref": 6, }, ], "scope": Object { - "$ref": 21, + "$ref": 25, }, }, Object { @@ -8714,7 +9433,7 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 25, }, }, Object { @@ -8752,13 +9471,101 @@ Object { }, ], "name": "C", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$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": 5, }, ], "scope": Object { - "$ref": 21, + "$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": 11, + }, + ], + "scope": Object { + "$ref": 25, }, }, ], @@ -8769,26 +9576,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 18, - }, - Object { - "$ref": 19, + "$ref": 22, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 22, + "$ref": 26, }, "variables": Array [], } @@ -8796,7 +9591,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -8806,7 +9601,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -8816,7 +9611,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -8829,9 +9624,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "Constructor", @@ -8846,9 +9641,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "M", @@ -8865,9 +9660,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "T", @@ -8878,14 +9673,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -8895,10 +9689,13 @@ Object { ], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "Base": Object { + "$ref": 3, + }, + "T": Object { "$ref": 2, }, "arguments": Object { @@ -8906,7 +9703,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -8917,11 +9714,55 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$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 { @@ -8957,7 +9798,7 @@ Object { "name": "Base", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -8968,15 +9809,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, - }, - Object { - "$ref": 5, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "M": Object { @@ -8984,7 +9822,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -9024,11 +9862,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -9039,17 +9877,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, - }, - Object { - "$ref": 5, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], } @@ -12476,7 +13311,7 @@ Object { exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -12486,7 +13321,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -12496,7 +13331,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -12506,7 +13341,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 25, @@ -12521,15 +13356,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -12540,13 +13378,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, @@ -12561,26 +13439,69 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { + "T": Object { + "$ref": 6, + }, "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, }, }, ], @@ -12592,7 +13513,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "A": Object { @@ -12600,7 +13521,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -12640,7 +13561,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -12652,7 +13573,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "A": Object { @@ -12660,7 +13581,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -12700,7 +13621,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -12714,7 +13635,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -12722,7 +13643,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12732,7 +13653,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12742,7 +13663,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -12757,19 +13678,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -12805,7 +13726,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -12817,19 +13738,62 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { "$id": 0, + "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": 4, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -12865,7 +13829,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -12879,7 +13843,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -12887,7 +13851,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -12897,7 +13861,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12907,7 +13871,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12922,19 +13886,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -12970,7 +13934,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -12980,9 +13944,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "Bar", @@ -12999,24 +13963,67 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, + "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": 5, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -13052,7 +14059,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -13063,14 +14070,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -13078,7 +14085,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -13088,7 +14095,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -13098,7 +14105,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -13113,19 +14120,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "A": Object { - "$ref": 1, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -13161,7 +14168,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -13173,19 +14180,62 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "A": Object { + "$ref": 1, + }, + "__P": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { "$id": 0, + "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": 4, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -13221,7 +14271,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -13235,7 +14285,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -16335,7 +17385,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16345,7 +17395,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16355,7 +17405,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 15, @@ -16370,11 +17420,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -16385,13 +17435,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "T": Object { + "$ref": 0, + }, }, - "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": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -16402,7 +17497,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -16410,7 +17505,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -16420,7 +17515,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16430,7 +17525,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 15, @@ -16445,11 +17540,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -16460,13 +17555,101 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 4, + }, + "variableMap": Object { + "T": Object { + "$ref": 0, + }, + "U": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, - "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, + 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": 3, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + ], + "name": "U", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -16477,7 +17660,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -16485,7 +17668,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -16495,7 +17678,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -16505,7 +17688,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -16520,19 +17703,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -16568,7 +17751,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -16580,19 +17763,62 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { + "$ref": 1, + }, + "T": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { "$id": 0, + "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": 4, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -16628,7 +17854,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -16642,7 +17868,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -16650,7 +17876,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -16660,7 +17886,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -16670,7 +17896,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 7, @@ -16685,19 +17911,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -16733,7 +17959,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -16745,19 +17971,105 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { + "$ref": 2, + }, + "T": Object { "$ref": 0, }, + "U": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, + "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": 5, + }, + }, + Object { + "$id": 1, + "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": 5, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { @@ -16793,7 +18105,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -16807,7 +18119,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -17458,7 +18770,7 @@ Object { exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17468,7 +18780,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -17478,7 +18790,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 7, @@ -17493,11 +18805,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -17508,13 +18820,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "TestAlias": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -17525,7 +18882,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -17533,7 +18890,7 @@ Object { exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17543,7 +18900,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -17553,7 +18910,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 7, @@ -17568,11 +18925,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -17583,13 +18940,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "TestClassProps": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -17600,7 +19002,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -17608,7 +19010,7 @@ Object { exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17618,7 +19020,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17628,7 +19030,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 7, @@ -17641,9 +19043,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -17660,16 +19062,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -17679,18 +19081,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "TestCallback": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -17698,14 +19145,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -17713,7 +19160,7 @@ Object { exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -17723,7 +19170,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -17733,7 +19180,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 10, @@ -17746,9 +19193,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "a", @@ -17760,7 +19207,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 4, }, "writeExpr": undefined, }, @@ -17768,18 +19215,21 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "a": Object { + "T": Object { "$ref": 3, }, + "a": Object { + "$ref": 4, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -17790,11 +19240,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 { @@ -17830,11 +19320,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -17846,7 +19336,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "obj", @@ -17872,7 +19362,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "obj": Object { @@ -17880,7 +19370,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -17930,7 +19420,7 @@ Object { }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -17944,7 +19434,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } @@ -19112,7 +20602,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -19122,7 +20612,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -19132,7 +20622,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19145,9 +20635,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "X", @@ -19158,13 +20648,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "X", @@ -19175,13 +20667,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "b", @@ -19193,33 +20687,29 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { + "X": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -19230,11 +20720,58 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$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 { @@ -19270,11 +20807,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 5, + "$ref": 6, }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -19283,17 +20820,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -19301,7 +20831,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -19341,7 +20871,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -19350,19 +20880,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], } @@ -19370,7 +20893,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, @@ -19380,7 +20903,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19390,7 +20913,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19405,15 +20928,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { + "T": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -19424,7 +20950,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, }, }, ], @@ -19436,7 +21002,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "compare": Object { @@ -19444,7 +21010,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -19484,7 +21050,7 @@ Object { "name": "compare", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -19498,7 +21064,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -19506,7 +21072,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -19516,7 +21082,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -19526,7 +21092,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19539,9 +21105,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "X", @@ -19552,13 +21118,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "X", @@ -19569,13 +21137,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "b", @@ -19587,33 +21157,29 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { + "X": Object { + "$ref": 2, + }, "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -19624,11 +21190,58 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$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 { @@ -19664,11 +21277,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 5, + "$ref": 6, }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -19677,17 +21290,10 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -19695,7 +21301,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -19735,7 +21341,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -19744,19 +21350,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], } @@ -20761,7 +22360,7 @@ Object { exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -20771,7 +22370,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -20781,7 +22380,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -20796,16 +22395,16 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], }, Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 29, @@ -20818,9 +22417,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "X", @@ -20835,9 +22434,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "Y", @@ -20852,6 +22451,225 @@ Object { "writeExpr": undefined, }, ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "type-alias", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + "B": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 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 [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "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, @@ -20886,11 +22704,56 @@ Object { "upperScope": Object { "$ref": 5, }, - "variableMap": Object {}, + "variableMap": Object { + "X": Object { + "$ref": 0, + }, + }, "variableScope": Object { "$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, @@ -20914,7 +22777,7 @@ Object { } `; -exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` +exports[`typescript fixtures/basics/interface-extends.src 1`] = ` Object { "$id": 4, "block": Object { @@ -20942,39 +22805,22 @@ Object { 0, 30, ], - "type": "TSTypeAliasDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, Object { "$id": 1, "from": Object { "$ref": 2, }, "identifier": Object { - "name": "B", + "name": "Bar", "range": Array [ 22, - 23, + 25, ], "type": "Identifier", }, @@ -20984,14 +22830,11 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, ], - "type": "type-alias", + "type": "interface", "upperScope": Object { "$ref": 3, }, @@ -21006,9 +22849,6 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -21017,119 +22857,56 @@ Object { "upperScope": Object { "$ref": 4, }, - "variableMap": Object {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "variableScope": Object { "$ref": 3, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-extends.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ + "variables": Array [ Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 30, - ], - "type": "TSInterfaceDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "Bar", + "name": Object { + "name": "Foo", "range": Array [ - 22, - 25, + 10, + 13, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "node": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", }, ], - "throughReferences": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 0, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, ], - "type": "interface", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, }, ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], }, ], "functionExpressionScope": false, @@ -21137,14 +22914,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -21152,7 +22929,7 @@ Object { exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -21162,7 +22939,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -21172,7 +22949,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21185,9 +22962,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "Bar", @@ -21202,9 +22979,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "Baz", @@ -21221,19 +22998,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], }, @@ -21243,21 +23020,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, @@ -21265,17 +23087,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -21283,7 +23105,7 @@ Object { exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -21293,7 +23115,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21303,7 +23125,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -21318,11 +23140,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -21333,13 +23155,101 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + "T": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "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": 3, + }, + }, + Object { + "$id": 1, + "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, @@ -21350,7 +23260,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -21358,7 +23268,7 @@ Object { exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 18, + "$id": 21, "block": Object { "range": Array [ 0, @@ -21368,7 +23278,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 17, + "$id": 20, "block": Object { "range": Array [ 0, @@ -21378,7 +23288,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 19, "block": Object { "range": Array [ 0, @@ -21391,9 +23301,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 3, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "bax", @@ -21408,9 +23318,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "baz", @@ -21425,9 +23335,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -21442,9 +23352,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -21459,9 +23369,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 7, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -21476,9 +23386,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 8, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "loo", @@ -21493,9 +23403,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 9, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -21510,9 +23420,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -21527,9 +23437,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 11, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -21544,9 +23454,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 12, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -21561,9 +23471,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 13, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -21578,9 +23488,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 14, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -21595,9 +23505,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 15, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -21612,9 +23522,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 16, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -21629,9 +23539,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 17, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -21646,9 +23556,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 18, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -21664,15 +23574,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, @@ -21712,63 +23613,151 @@ Object { Object { "$ref": 15, }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, ], "type": "interface", "upperScope": Object { - "$ref": 17, + "$ref": 20, + }, + "variableMap": Object { + "F": Object { + "$ref": 2, + }, + "J": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 17, + "$ref": 20, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, - Object { - "$ref": 12, - }, - Object { - "$ref": 13, + "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, @@ -21776,31 +23765,76 @@ Object { Object { "$ref": 15, }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, ], "type": "module", "upperScope": Object { - "$ref": 18, + "$ref": 21, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 17, + "$ref": 20, }, - "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, + 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": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, @@ -21840,12 +23874,21 @@ Object { Object { "$ref": 15, }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 18, + "$ref": 21, }, "variables": Array [], } @@ -21853,7 +23896,7 @@ Object { exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -21863,7 +23906,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -21873,7 +23916,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21886,9 +23929,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "x", @@ -21903,9 +23946,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "y", @@ -21922,19 +23965,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], }, @@ -21944,21 +23987,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, + }, + "variableMap": Object { + "Test": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, - "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, + 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, @@ -21966,17 +24054,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -21984,7 +24072,7 @@ Object { exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -21994,7 +24082,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22004,7 +24092,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22017,9 +24105,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -22036,16 +24124,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -22055,18 +24143,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, + 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, @@ -22074,14 +24207,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -22089,7 +24222,7 @@ Object { exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -22099,7 +24232,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -22109,7 +24242,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22122,9 +24255,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 4, }, "identifier": Object { "name": "Bar", @@ -22139,9 +24272,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 2, + "$ref": 4, }, "identifier": Object { "name": "J", @@ -22158,19 +24291,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, }, Object { - "$ref": 1, + "$ref": 3, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [], }, @@ -22180,21 +24313,109 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, }, Object { - "$ref": 1, + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + "T": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "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": 5, + }, + }, + Object { + "$id": 1, + "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, @@ -22202,17 +24423,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, }, Object { - "$ref": 1, + "$ref": 3, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -22220,7 +24441,7 @@ Object { exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22230,7 +24451,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22240,7 +24461,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22255,11 +24476,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -22270,13 +24491,101 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 4, + }, + "variableMap": Object { + "T": Object { + "$ref": 0, + }, + "Test": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "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": 3, + }, + }, + Object { + "$id": 1, + "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, @@ -22287,7 +24596,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -22295,7 +24604,7 @@ Object { exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22305,7 +24614,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22315,7 +24624,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22328,9 +24637,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -22347,16 +24656,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -22366,18 +24675,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "Test": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -22385,14 +24739,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -22400,7 +24754,7 @@ Object { exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -22410,7 +24764,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -22420,7 +24774,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -22433,9 +24787,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "bar", @@ -22450,9 +24804,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "bar", @@ -22467,9 +24821,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -22480,13 +24834,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -22497,14 +24853,258 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, + }, + Object { + "$ref": 3, }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "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", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "test": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 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", + "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, }, @@ -22530,9 +25130,6 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -22547,192 +25144,77 @@ Object { "upperScope": Object { "$ref": 6, }, - "variableMap": Object {}, + "variableMap": Object { + "test": Object { + "$ref": 0, + }, + }, "variableScope": Object { "$ref": 5, }, - "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": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ + "variables": Array [ Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "TSInterfaceDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 54, - 57, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, + "$id": 0, + "defs": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "bar", + "name": Object { + "name": "test", "range": Array [ - 59, - 71, + 10, + 14, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "baz", + "node": Object { "range": Array [ - 73, - 77, + 0, + 81, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "parent": null, + "type": "InterfaceName", }, ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 2, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", }, ], - "type": "interface", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, }, ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, Object { "$ref": 2, }, + Object { + "$ref": 3, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -22740,7 +25222,7 @@ Object { exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22750,7 +25232,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22760,7 +25242,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -22775,11 +25257,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -22790,13 +25272,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "test": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -22807,7 +25334,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -22815,7 +25342,7 @@ Object { exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22825,7 +25352,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22835,7 +25362,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22848,9 +25375,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "foo", @@ -22867,16 +25394,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -22886,18 +25413,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -22905,14 +25477,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -25235,7 +27807,7 @@ Object { exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, @@ -25245,7 +27817,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, @@ -25255,7 +27827,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 29, @@ -25270,15 +27842,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { + "T": Object { + "$ref": 3, + }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -25289,13 +27864,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, @@ -25310,32 +27925,75 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { + "T": Object { + "$ref": 6, + }, "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, @@ -25350,32 +28008,32 @@ Object { "throughReferences": Array [], "type": "function", "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, @@ -25390,33 +28048,33 @@ Object { "throughReferences": Array [], "type": "function", "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 { @@ -25452,7 +28110,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, ], @@ -25464,7 +28122,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "foo", @@ -25490,7 +28148,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 14, }, "variableMap": Object { "foo": Object { @@ -25498,7 +28156,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 13, }, "variables": Array [ Object { @@ -25548,7 +28206,7 @@ Object { }, ], "scope": Object { - "$ref": 11, + "$ref": 13, }, }, ], @@ -25562,7 +28220,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, "variables": Array [], } @@ -28481,7 +31139,7 @@ Object { exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -28491,7 +31149,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -28501,7 +31159,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -28514,9 +31172,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "Success", @@ -28531,9 +31189,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -28544,13 +31202,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "Failure", @@ -28567,24 +31227,70 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 4, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + 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, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28592,24 +31298,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 7, + }, + "variableMap": Object { + "Result": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + ], + "name": "Result", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28617,20 +31365,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [], } @@ -28638,7 +31383,7 @@ Object { exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -28648,7 +31393,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -28658,7 +31403,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -28671,9 +31416,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "Success", @@ -28688,9 +31433,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -28701,13 +31446,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "Failure", @@ -28724,24 +31471,70 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 4, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 11, + 25, + ], + "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, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28749,24 +31542,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 7, + }, + "variableMap": Object { + "Result": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + ], + "name": "Result", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -28774,20 +31609,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [], } @@ -28795,7 +31627,7 @@ Object { exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -28805,7 +31637,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28815,7 +31647,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28830,11 +31662,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -28845,13 +31677,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, + 30, + ], + "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, @@ -28862,7 +31739,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -29298,7 +32175,7 @@ Object { exports[`typescript fixtures/basics/type-assertion-in-interface.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -29308,7 +32185,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -29318,7 +32195,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29331,9 +32208,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "node", @@ -29348,9 +32225,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "node", @@ -29367,19 +32244,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], }, @@ -29389,21 +32266,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, + }, + "variableMap": Object { + "AssertFoo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$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, @@ -29411,17 +32333,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -29882,150 +32804,319 @@ Object { } `; -exports[`typescript fixtures/basics/type-assertion-with-guard-in-function.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-with-guard-in-function.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "assertsStringGuard": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "assertsStringGuard", + "range": Array [ + 9, + 27, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "assertsStringGuard", + "range": Array [ + 9, + 27, + ], + "type": "Identifier", + }, + ], + "name": "assertsStringGuard", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-with-guard-in-interface.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, - 72, + 71, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, - 72, + 71, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 71, + 70, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { - "name": "x", + "name": "node", "range": Array [ - 45, - 46, + 33, + 42, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, + "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 [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { + "throughReferences": Array [ + Object { "$ref": 1, }, - "x": Object { + Object { "$ref": 2, }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 28, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 28, - 34, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { - "assertsStringGuard": Object { + "AssertFoo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -30033,166 +33124,42 @@ Object { "defs": Array [ Object { "name": Object { - "name": "assertsStringGuard", + "name": "AssertFoo", "range": Array [ - 9, - 27, + 10, + 19, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 71, + 70, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "assertsStringGuard", + "name": "AssertFoo", "range": Array [ - 9, - 27, + 10, + 19, ], "type": "Identifier", }, ], - "name": "assertsStringGuard", + "name": "AssertFoo", "references": Array [], "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-assertion-with-guard-in-interface.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 71, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "TSInterfaceDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "node", - "range": Array [ - 33, - 42, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "node", - "range": Array [ - 53, - 57, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - ], - "type": "interface", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, + "$ref": 4, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, }, ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], }, ], "functionExpressionScope": false, @@ -30200,17 +33167,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -30920,7 +33887,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-interface.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -30930,7 +33897,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -30940,7 +33907,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -30953,9 +33920,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "node", @@ -30970,9 +33937,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "node", @@ -30989,19 +33956,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], }, @@ -31011,21 +33978,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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, + 56, + ], + "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, @@ -31033,17 +34045,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -31336,7 +34348,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` Object { - "$id": 10, + "$id": 12, "block": Object { "range": Array [ 0, @@ -31346,7 +34358,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 11, "block": Object { "range": Array [ 0, @@ -31356,7 +34368,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 44, @@ -31371,15 +34383,18 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 11, }, "variableMap": Object { + "A": Object { + "$ref": 5, + }, "arguments": Object { "$ref": 4, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -31390,13 +34405,53 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$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": 8, + "$id": 10, "block": Object { "range": Array [ 88, @@ -31409,9 +34464,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 8, + "$ref": 10, }, "identifier": Object { "name": "Foo", @@ -31428,31 +34483,74 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 7, + "$ref": 9, }, ], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 11, }, "variableMap": Object { + "A": Object { + "$ref": 8, + }, "arguments": Object { - "$ref": 6, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [ Object { - "$id": 6, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 8, + "$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, }, }, ], @@ -31464,7 +34562,7 @@ Object { Object { "$id": 2, "from": Object { - "$ref": 9, + "$ref": 11, }, "identifier": Object { "name": "A", @@ -31481,7 +34579,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 9, + "$ref": 11, }, "identifier": Object { "name": "foo", @@ -31504,12 +34602,12 @@ Object { "$ref": 3, }, Object { - "$ref": 7, + "$ref": 9, }, ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 12, }, "variableMap": Object { "bar": Object { @@ -31520,7 +34618,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 11, }, "variables": Array [ Object { @@ -31560,7 +34658,7 @@ Object { "name": "bar", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 11, }, }, Object { @@ -31600,7 +34698,7 @@ Object { "name": "baz", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 11, }, }, ], @@ -31617,14 +34715,14 @@ Object { "$ref": 3, }, Object { - "$ref": 7, + "$ref": 9, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 12, }, "variables": Array [], } @@ -31632,7 +34730,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 17, + "$id": 20, "block": Object { "range": Array [ 0, @@ -31642,7 +34740,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 19, "block": Object { "range": Array [ 0, @@ -31652,7 +34750,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 10, "block": Object { "range": Array [ 0, @@ -31667,19 +34765,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 16, + "$ref": 19, }, "variableMap": Object { "foo": Object { - "$ref": 6, + "$ref": 9, }, }, "variableScope": Object { - "$ref": 16, + "$ref": 19, }, "variables": Array [ Object { - "$id": 6, + "$id": 9, "defs": Array [ Object { "name": Object { @@ -31715,13 +34813,13 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 10, }, }, ], }, Object { - "$id": 9, + "$id": 12, "block": Object { "range": Array [ 75, @@ -31736,19 +34834,19 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 16, + "$ref": 19, }, "variableMap": Object { "foo2": Object { - "$ref": 8, + "$ref": 11, }, }, "variableScope": Object { - "$ref": 16, + "$ref": 19, }, "variables": Array [ Object { - "$id": 8, + "$id": 11, "defs": Array [ Object { "name": Object { @@ -31784,13 +34882,13 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 12, }, }, ], }, Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 165, @@ -31803,9 +34901,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 10, + "$id": 13, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "bar2", @@ -31816,13 +34914,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 4, + }, "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 14, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "A", @@ -31833,30 +34933,32 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 10, + "$ref": 13, }, Object { - "$ref": 11, + "$ref": 14, }, ], "type": "interface", "upperScope": Object { - "$ref": 16, + "$ref": 19, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 19, }, "variables": Array [], }, Object { - "$id": 15, + "$id": 18, "block": Object { "range": Array [ 245, @@ -31869,9 +34971,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 13, + "$id": 16, "from": Object { - "$ref": 15, + "$ref": 18, }, "identifier": Object { "name": "bar", @@ -31882,13 +34984,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 3, + }, "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 17, "from": Object { - "$ref": 15, + "$ref": 18, }, "identifier": Object { "name": "A", @@ -31899,25 +35003,27 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 13, + "$ref": 16, }, Object { - "$ref": 14, + "$ref": 17, }, ], "type": "interface", "upperScope": Object { - "$ref": 16, + "$ref": 19, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 19, }, "variables": Array [], }, @@ -31926,9 +35032,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "A", @@ -31939,13 +35045,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "bar", @@ -31956,13 +35064,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 3, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 7, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "A", @@ -31973,13 +35083,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 8, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "bar", @@ -31989,55 +35101,175 @@ Object { ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 20, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + "bar": Object { + "$ref": 3, + }, + "bar2": Object { + "$ref": 4, + }, + "foo": Object { + "$ref": 1, + }, + "foo2": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 19, + }, + "variables": Array [ + Object { + "$id": 0, + "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", + }, + Object { + "name": Object { + "name": "A", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 86, + 124, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "A", + "range": Array [ + 191, + 192, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 179, + 203, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "A", + "range": Array [ + 272, + 273, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 260, + 298, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + Object { + "name": "A", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + Object { + "name": "A", + "range": Array [ + 191, + 192, + ], + "type": "Identifier", + }, + Object { + "name": "A", + "range": Array [ + 272, + 273, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 17, + }, + ], + "scope": Object { + "$ref": 19, + }, }, Object { - "$ref": 5, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - "foo2": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 16, - }, - "variables": Array [ - Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -32073,11 +35305,11 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 16, + "$ref": 19, }, }, Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -32113,7 +35345,101 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 16, + "$ref": 19, + }, + }, + Object { + "$id": 3, + "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": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 16, + }, + ], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 4, + "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": 13, + }, + ], + "scope": Object { + "$ref": 19, }, }, ], @@ -32122,37 +35448,12 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 17, + "$ref": 20, }, "variables": Array [], } @@ -32355,7 +35656,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32365,7 +35666,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32375,7 +35676,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32390,11 +35691,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -32405,13 +35706,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -32422,7 +35768,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -32430,7 +35776,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32440,7 +35786,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32450,7 +35796,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32465,11 +35811,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -32480,13 +35826,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -32497,7 +35888,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -32505,7 +35896,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32515,7 +35906,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32525,7 +35916,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32540,11 +35931,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -32555,13 +35946,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -32572,7 +36008,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -32580,7 +36016,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32590,7 +36026,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32600,7 +36036,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32615,11 +36051,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -32630,13 +36066,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -32647,7 +36128,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -32655,7 +36136,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32665,7 +36146,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32675,7 +36156,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32690,28 +36171,73 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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, }, - "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, @@ -32722,7 +36248,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -32730,7 +36256,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32740,7 +36266,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32750,7 +36276,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32765,11 +36291,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -32780,13 +36306,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -32797,7 +36368,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -32805,7 +36376,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32815,7 +36386,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32825,7 +36396,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32840,11 +36411,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -32855,13 +36426,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -32872,7 +36488,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -32880,7 +36496,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32890,7 +36506,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32900,7 +36516,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32915,11 +36531,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -32930,13 +36546,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -32947,7 +36608,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -32955,7 +36616,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32965,7 +36626,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32975,7 +36636,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -32990,11 +36651,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -33005,13 +36666,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -33022,7 +36728,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -33030,7 +36736,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -33040,7 +36746,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -33050,7 +36756,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -33065,11 +36771,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -33080,13 +36786,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -33097,7 +36848,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -33105,7 +36856,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -33115,7 +36866,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -33125,7 +36876,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -33140,11 +36891,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -33155,13 +36906,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -33172,7 +36968,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -33180,7 +36976,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -33190,7 +36986,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -33200,7 +36996,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -33215,11 +37011,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -33230,13 +37026,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -33247,7 +37088,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -33255,7 +37096,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -33265,7 +37106,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -33275,7 +37116,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -33290,28 +37131,73 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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, }, - "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, @@ -33322,7 +37208,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -33330,7 +37216,7 @@ Object { exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -33340,7 +37226,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -33350,7 +37236,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -33363,9 +37249,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "bar", @@ -33380,9 +37266,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "bar", @@ -33397,9 +37283,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -33410,13 +37296,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -33427,17 +37315,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -33447,25 +37331,71 @@ Object { ], "type": "type-alias", "upperScope": Object { - "$ref": 5, + "$ref": 7, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, - "variables": Array [], + "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 [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -33475,25 +37405,64 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 8, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$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 [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -33505,7 +37474,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } @@ -33513,7 +37482,7 @@ Object { exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -33523,7 +37492,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -33533,7 +37502,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -33546,9 +37515,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "onclick", @@ -33563,9 +37532,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "this", @@ -33580,9 +37549,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "e", @@ -33597,9 +37566,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "Event", @@ -33615,9 +37584,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -33627,14 +37593,17 @@ Object { Object { "$ref": 3, }, + Object { + "$ref": 4, + }, ], "type": "interface", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], }, @@ -33643,9 +37612,6 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -33655,25 +37621,70 @@ Object { Object { "$ref": 3, }, + Object { + "$ref": 4, + }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 7, + }, + "variableMap": Object { + "UIElement": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$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 [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -33683,12 +37694,15 @@ Object { Object { "$ref": 3, }, + Object { + "$ref": 4, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -33696,7 +37710,7 @@ Object { exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -33706,7 +37720,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -33716,7 +37730,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -33731,11 +37745,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -33746,13 +37760,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -33763,7 +37822,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -35166,7 +39225,7 @@ Object { exports[`typescript fixtures/declare/interface.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35176,7 +39235,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35186,7 +39245,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -35201,11 +39260,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -35216,13 +39275,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -35233,7 +39337,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -35481,7 +39585,7 @@ Object { exports[`typescript fixtures/declare/type-alias.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35491,7 +39595,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35501,7 +39605,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -35516,11 +39620,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -35531,13 +39635,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -35548,7 +39697,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -42289,7 +46438,7 @@ Object { exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -42299,7 +46448,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42309,7 +46458,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42324,11 +46473,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -42339,13 +46488,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "M": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -42356,7 +46550,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43630,7 +47824,7 @@ Object { exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43640,7 +47834,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43650,7 +47844,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -43665,11 +47859,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -43680,13 +47874,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, + 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, @@ -43697,7 +47936,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43825,7 +48064,7 @@ Object { exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43835,7 +48074,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43845,7 +48084,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -43860,11 +48099,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -43875,13 +48114,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -43892,7 +48176,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43900,7 +48184,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43910,7 +48194,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43920,7 +48204,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -43935,11 +48219,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -43950,13 +48234,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -43967,7 +48296,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43975,7 +48304,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43985,7 +48314,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43995,7 +48324,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -44010,11 +48339,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -44025,13 +48354,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "d": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "d", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "d", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "d", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -44042,7 +48416,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44050,7 +48424,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44060,7 +48434,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44070,7 +48444,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -44082,31 +48456,76 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "interface", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "throughReferences": Array [], + "type": "interface", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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, }, - "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, @@ -44117,7 +48536,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44125,7 +48544,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44135,7 +48554,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44145,7 +48564,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -44160,11 +48579,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -44175,13 +48594,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -44192,7 +48656,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44200,7 +48664,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44210,7 +48674,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44220,7 +48684,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -44235,11 +48699,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -44250,13 +48714,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -44267,7 +48776,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44275,7 +48784,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44285,7 +48794,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44295,7 +48804,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -44310,11 +48819,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -44325,13 +48834,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -44342,7 +48896,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44350,7 +48904,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44360,7 +48914,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44370,7 +48924,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -44385,11 +48939,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -44400,13 +48954,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -44417,7 +49016,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -44425,7 +49024,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -44435,7 +49034,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44445,7 +49044,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44458,9 +49057,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -44477,16 +49076,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -44496,18 +49095,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -44515,14 +49159,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -44530,7 +49174,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -44540,7 +49184,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44550,7 +49194,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44563,9 +49207,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -44582,16 +49226,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -44601,18 +49245,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -44620,14 +49309,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -44635,7 +49324,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-protected.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -44645,7 +49334,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44655,7 +49344,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44668,9 +49357,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -44687,16 +49376,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -44706,18 +49395,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { + "$ref": 1, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { "$ref": 0, }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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, + }, + }, ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], }, ], "functionExpressionScope": false, @@ -44725,14 +49459,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -44740,7 +49474,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -44750,7 +49484,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44760,7 +49494,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44773,9 +49507,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -44792,16 +49526,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -44811,18 +49545,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -44830,14 +49609,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -44845,7 +49624,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-readonly.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -44855,7 +49634,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44865,7 +49644,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44878,9 +49657,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -44897,16 +49676,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -44916,18 +49695,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -44935,14 +49759,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -44950,7 +49774,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -44960,7 +49784,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -44970,7 +49794,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44983,9 +49807,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -45002,16 +49826,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -45021,18 +49845,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -45040,14 +49909,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -45055,7 +49924,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -45065,7 +49934,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -45075,7 +49944,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45088,9 +49957,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "bar", @@ -45105,9 +49974,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "baz", @@ -45124,19 +49993,19 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], }, @@ -45146,21 +50015,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "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, + 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, @@ -45168,17 +50082,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -45186,7 +50100,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45196,7 +50110,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45206,7 +50120,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -45221,11 +50135,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -45236,13 +50150,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -45253,7 +50212,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45261,7 +50220,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45271,7 +50230,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45281,7 +50240,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -45296,11 +50255,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -45311,13 +50270,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -45328,7 +50332,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45336,7 +50340,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45346,7 +50350,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45356,7 +50360,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -45368,31 +50372,76 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "interface", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "throughReferences": Array [], + "type": "interface", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 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, }, - "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, @@ -45403,7 +50452,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45411,7 +50460,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45421,7 +50470,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45431,7 +50480,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -45446,11 +50495,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -45461,13 +50510,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -45478,7 +50572,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45486,7 +50580,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-static.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45496,7 +50590,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45506,7 +50600,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -45521,11 +50615,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -45536,13 +50630,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -45553,7 +50692,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45561,7 +50700,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-with-default-value.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45571,7 +50710,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45581,7 +50720,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -45596,11 +50735,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -45611,13 +50750,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -45628,7 +50812,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45638,7 +50822,7 @@ exports[`typescript fixtures/errorRecovery/interface-with-no-body.src 1`] = `"'{ exports[`typescript fixtures/errorRecovery/interface-with-optional-index-signature.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -45648,7 +50832,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -45658,7 +50842,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -45673,11 +50857,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -45688,13 +50872,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -45705,7 +50934,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -47356,7 +52585,7 @@ Object { exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` Object { - "$id": 15, + "$id": 16, "block": Object { "range": Array [ 0, @@ -47366,7 +52595,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 15, "block": Object { "range": Array [ 0, @@ -47376,7 +52605,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 14, "block": Object { "range": Array [ 9, @@ -47528,7 +52757,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 13, + "$ref": 14, }, "variableMap": Object { "Point": Object { @@ -47536,7 +52765,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, "variables": Array [ Object { @@ -47582,7 +52811,7 @@ Object { ], }, Object { - "$id": 12, + "$id": 13, "block": Object { "range": Array [ 156, @@ -47592,7 +52821,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 173, @@ -47607,11 +52836,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 12, + "$ref": 13, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, "variables": Array [], }, @@ -47622,13 +52851,58 @@ Object { "throughReferences": Array [], "type": "block", "upperScope": Object { - "$ref": 13, + "$ref": 14, + }, + "variableMap": Object { + "Id": Object { + "$ref": 11, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, - "variables": Array [], + "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": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Id", + "range": Array [ + 183, + 185, + ], + "type": "Identifier", + }, + ], + "name": "Id", + "references": Array [], + "scope": Object { + "$ref": 13, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -47637,7 +52911,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 13, + "$ref": 14, }, "identifier": Object { "name": "x", @@ -47667,7 +52941,7 @@ Object { ], "type": "block", "upperScope": Object { - "$ref": 14, + "$ref": 15, }, "variableMap": Object { "B": Object { @@ -47678,7 +52952,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, "variables": Array [ Object { @@ -47718,7 +52992,7 @@ Object { "name": "Point", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 14, }, }, Object { @@ -47758,7 +53032,7 @@ Object { "name": "B", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 14, }, }, ], @@ -47770,7 +53044,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 15, + "$ref": 16, }, "variableMap": Object { "A": Object { @@ -47781,7 +53055,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, "variables": Array [ Object { @@ -47821,7 +53095,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 15, }, }, Object { @@ -47871,7 +53145,7 @@ Object { }, ], "scope": Object { - "$ref": 14, + "$ref": 15, }, }, ], @@ -47885,7 +53159,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 16, }, "variables": Array [], } @@ -47943,7 +53217,7 @@ Object { exports[`typescript fixtures/types/array-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -47953,7 +53227,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -47963,7 +53237,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -47978,11 +53252,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -47993,13 +53267,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, + 19, + ], + "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, @@ -48010,7 +53329,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -48119,7 +53438,7 @@ Object { exports[`typescript fixtures/types/conditional-infer.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -48129,7 +53448,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -48139,7 +53458,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -48152,9 +53471,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -48165,13 +53484,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "U", @@ -48186,9 +53507,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "U", @@ -48203,9 +53524,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -48215,34 +53536,82 @@ Object { ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "type-alias", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 12, + 15, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, }, ], - "type": "type-alias", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], }, ], "functionExpressionScope": false, @@ -48250,27 +53619,66 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 3, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 8, + }, + "variableMap": Object { + "Element": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$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, @@ -48278,23 +53686,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 3, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } @@ -48302,7 +53704,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` Object { - "$id": 13, + "$id": 15, "block": Object { "range": Array [ 0, @@ -48312,7 +53714,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, @@ -48322,7 +53724,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, @@ -48335,9 +53737,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -48348,13 +53750,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -48369,9 +53773,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -48386,9 +53790,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -48399,13 +53803,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -48420,9 +53826,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -48437,9 +53843,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 8, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -48450,13 +53856,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "Promise", @@ -48471,9 +53879,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -48488,9 +53896,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 11, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -48505,9 +53913,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 12, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -48518,148 +53926,217 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, Object { "$ref": 4, }, - Object { - "$ref": 5, - }, Object { "$ref": 6, }, Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, Object { "$ref": 10, }, + Object { + "$ref": 11, + }, ], "type": "type-alias", "upperScope": Object { - "$ref": 12, + "$ref": 14, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, - "variables": Array [], + "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": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, Object { "$ref": 4, }, - Object { - "$ref": 5, - }, Object { "$ref": 6, }, Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, Object { "$ref": 10, }, + Object { + "$ref": 11, + }, ], "type": "module", "upperScope": Object { - "$ref": 13, + "$ref": 15, + }, + "variableMap": Object { + "Unpacked": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Unpacked", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 126, + ], + "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": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, Object { "$ref": 4, }, - Object { - "$ref": 5, - }, Object { "$ref": 6, }, Object { "$ref": 7, }, - Object { - "$ref": 8, - }, Object { "$ref": 9, }, Object { "$ref": 10, }, + Object { + "$ref": 11, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 15, }, "variables": Array [], } @@ -48667,7 +54144,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -48677,7 +54154,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -48687,7 +54164,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -48700,9 +54177,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -48713,13 +54190,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "U", @@ -48734,9 +54213,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "U", @@ -48751,9 +54230,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "U", @@ -48770,27 +54249,73 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 3, }, Object { - "$ref": 2, + "$ref": 4, }, Object { - "$ref": 3, + "$ref": 5, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 5, + "$ref": 7, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, - "variables": Array [], + "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, @@ -48798,27 +54323,69 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 3, }, Object { - "$ref": 2, + "$ref": 4, }, Object { - "$ref": 3, + "$ref": 5, }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 8, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$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, + 63, + ], + "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, @@ -48826,23 +54393,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, + "$ref": 3, }, Object { - "$ref": 2, + "$ref": 4, }, Object { - "$ref": 3, + "$ref": 5, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } @@ -49101,7 +54665,7 @@ Object { exports[`typescript fixtures/types/constructor-generic.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -49111,7 +54675,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -49124,9 +54688,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "a", @@ -49141,9 +54705,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -49154,13 +54718,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -49171,32 +54737,31 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, - Object { - "$ref": 3, - }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { + "T": Object { + "$ref": 1, + }, "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -49242,7 +54807,54 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 4, + "$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, }, }, ], @@ -49252,21 +54864,15 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, - Object { - "$ref": 3, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -49678,7 +55284,7 @@ Object { exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -49688,7 +55294,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -49701,9 +55307,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "a", @@ -49718,9 +55324,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -49731,13 +55337,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -49748,32 +55356,31 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, - Object { - "$ref": 3, - }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { + "T": Object { + "$ref": 1, + }, "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -49819,7 +55426,54 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 4, + "$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, }, }, ], @@ -49829,21 +55483,15 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, - Object { - "$ref": 3, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -49978,7 +55626,7 @@ Object { exports[`typescript fixtures/types/function-with-array-destruction.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -49988,7 +55636,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -49998,7 +55646,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50011,9 +55659,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -50030,16 +55678,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -50049,18 +55697,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -50068,14 +55761,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -50083,7 +55776,7 @@ Object { exports[`typescript fixtures/types/function-with-object-destruction.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -50093,7 +55786,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -50103,7 +55796,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50116,9 +55809,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -50135,16 +55828,16 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -50154,18 +55847,63 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$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, @@ -50173,14 +55911,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 1, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -50442,7 +56180,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -50452,7 +56190,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50462,7 +56200,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50477,11 +56215,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -50492,13 +56230,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -50509,7 +56292,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -50517,7 +56300,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -50527,7 +56310,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50537,7 +56320,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50552,11 +56335,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -50567,13 +56350,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -50584,7 +56412,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -50592,7 +56420,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -50602,7 +56430,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -50612,7 +56440,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -50627,11 +56455,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -50642,13 +56470,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -50659,7 +56532,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -50817,7 +56690,7 @@ Object { exports[`typescript fixtures/types/intersection-type.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -50827,7 +56700,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -50837,7 +56710,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -50850,9 +56723,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -50863,13 +56736,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "LinkedList", @@ -50880,13 +56755,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -50897,76 +56774,153 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 1, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, + "$ref": 3, }, ], "type": "type-alias", "upperScope": Object { - "$ref": 4, + "$ref": 6, + }, + "variableMap": Object { + "T": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, - "variables": Array [], + "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 [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 7, + }, + "variableMap": Object { + "LinkedList": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$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, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [], } @@ -51912,7 +57866,7 @@ Object { exports[`typescript fixtures/types/nested-types.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -51922,7 +57876,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -51932,7 +57886,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -51947,11 +57901,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -51962,13 +57916,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -51979,7 +57978,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -51987,7 +57986,7 @@ Object { exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -51997,7 +57996,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -52007,7 +58006,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -52022,11 +58021,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -52037,13 +58036,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -52054,7 +58098,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -53638,143 +59682,269 @@ Object { } `; -exports[`typescript fixtures/types/tuple-optional.src 1`] = ` +exports[`typescript fixtures/types/tuple-optional.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/tuple-rest.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 28, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/tuple-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 45, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 45, + 29, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ + "childScopes": 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", + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, "references": Array [], - "scope": Object { - "$ref": 1, + "throughReferences": Array [], + "type": "type-alias", + "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 {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/tuple-rest.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { - "x": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -53782,123 +59952,42 @@ 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, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/tuple-type.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSTypeAliasDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "type-alias", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 2, }, - "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, @@ -53909,7 +59998,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -54569,7 +60658,7 @@ Object { exports[`typescript fixtures/types/union-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -54579,7 +60668,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -54589,7 +60678,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -54604,11 +60693,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -54619,13 +60708,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$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, @@ -54636,7 +60770,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } From 6ffd678300859e1613f5595a79a7b38a8096d4aa Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 22:15:07 +0100 Subject: [PATCH 08/12] fix(parser): fix visiting classes and add setTypes --- packages/parser/src/analyze-scope.ts | 28 +- packages/parser/src/scope/scopes.ts | 180 +- .../tests/lib/__snapshots__/basics.ts.snap | 23 + .../lib/__snapshots__/javascript.ts.snap | 1012 ++++ .../tests/lib/__snapshots__/jsx.ts.snap | 54 + .../lib/__snapshots__/scope-analysis.ts.snap | 2036 +++++--- .../tests/lib/__snapshots__/tsx.ts.snap | 15 +- .../lib/__snapshots__/typescript.ts.snap | 4632 ++++++++++------- packages/parser/tests/tools/scope-analysis.ts | 7 + 9 files changed, 5378 insertions(+), 2609 deletions(-) diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 8da7f7a88347..0a92433bbf79 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -150,7 +150,31 @@ 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; @@ -165,7 +189,9 @@ class Referencer extends TSESLintScope.Referencer { } this.typeMode = upperTypeMode; - super.visitClass(node); + this.visit(node.body); + + this.close(node); } /** diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index 4f7d2a930e33..9e7c6b403d6d 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -6,11 +6,45 @@ import { import { ScopeManager } from './scope-manager'; export class Scope extends TSESLintScope.Scope { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + /** @internal */ __defineType(node: TSESTree.Node, def: TSESLintScope.Definition): void { if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.set, this.variables, node, def); + this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); + } + } + + __resolveType(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; + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + return super.__resolve(ref); } } @@ -59,10 +93,44 @@ export class TypeAliasScope extends Scope { /// eslint scopes export class GlobalScope extends TSESLintScope.GlobalScope implements Scope { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + + __resolveType(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; + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + 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.set, this.variables, node, def); + 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); @@ -92,29 +160,131 @@ export class GlobalScope extends TSESLintScope.GlobalScope implements Scope { export class FunctionExpressionNameScope extends TSESLintScope.FunctionExpressionNameScope implements Scope { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + + __resolveType(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; + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + 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.set, this.variables, node, def); + this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); } } } export class WithScope extends TSESLintScope.WithScope implements Scope { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + + __resolveType(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; + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + 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.set, this.variables, node, def); + this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); } } } export class FunctionScope extends TSESLintScope.FunctionScope implements Scope { + setTypes: Map = new Map(); + types: TSESLintScope.Variable[] = []; + + __resolveType(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; + } + + /** @internal */ + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + 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.set, this.variables, node, def); + this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); } } } 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 fd6ccced4fe7..570c4dab0034 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 { @@ -401,15 +407,101 @@ 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": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 6, + "$ref": 1, }, }, "variableScope": Object { @@ -417,7 +509,7 @@ Object { }, "variables": Array [ Object { - "$id": 6, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -456,103 +548,74 @@ 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": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Component", - "range": Array [ - 31, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Nullable", - "range": Array [ - 41, - 49, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "SomeOther", - "range": Array [ - 50, - 59, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Component2", - "range": Array [ - 67, - 77, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "Nullable": Object { "$ref": 0, }, }, @@ -562,50 +625,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -652,16 +671,17 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -753,6 +773,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -860,6 +881,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -983,6 +1005,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1014,7 +1037,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, @@ -1025,15 +1048,38 @@ 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": 15, }, "variableMap": Object { "Foo": Object { - "$ref": 9, + "$ref": 6, }, }, "variableScope": Object { @@ -1041,7 +1087,7 @@ Object { }, "variables": Array [ Object { - "$id": 9, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -1077,13 +1123,13 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 8, }, }, ], }, Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 42, @@ -1094,15 +1140,38 @@ 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": 15, }, "variableMap": Object { "Foo2": Object { - "$ref": 11, + "$ref": 9, }, }, "variableScope": Object { @@ -1110,7 +1179,7 @@ Object { }, "variables": Array [ Object { - "$id": 11, + "$id": 9, "defs": Array [ Object { "name": Object { @@ -1146,32 +1215,55 @@ Object { "name": "Foo2", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, ], - }, - Object { - "$id": 14, - "block": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], + }, + 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": 13, + "$ref": 12, }, }, "variableScope": Object { @@ -1179,7 +1271,7 @@ Object { }, "variables": Array [ Object { - "$id": 13, + "$id": 12, "defs": Array [ Object { "name": Object { @@ -1229,23 +1321,6 @@ Object { "from": Object { "$ref": 15, }, - "identifier": Object { - "name": "Baz", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 15, - }, "identifier": Object { "name": "Bar", "range": Array [ @@ -1259,24 +1334,7 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, - "from": Object { - "$ref": 15, - }, - "identifier": Object { - "name": "Baz", - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, + "$id": 4, "from": Object { "$ref": 15, }, @@ -1293,24 +1351,7 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, - "from": Object { - "$ref": 15, - }, - "identifier": Object { - "name": "Baz", - "range": Array [ - 107, - 110, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 8, + "$id": 5, "from": Object { "$ref": 15, }, @@ -1332,22 +1373,23 @@ Object { "$ref": 3, }, Object { - "$ref": 4, + "$ref": 7, }, Object { - "$ref": 5, + "$ref": 4, }, Object { - "$ref": 6, + "$ref": 10, }, Object { - "$ref": 7, + "$ref": 5, }, Object { - "$ref": 8, + "$ref": 13, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 16, }, @@ -1497,22 +1539,23 @@ Object { "$ref": 3, }, Object { - "$ref": 4, + "$ref": 7, }, Object { - "$ref": 5, + "$ref": 4, }, Object { - "$ref": 6, + "$ref": 10, }, Object { - "$ref": 7, + "$ref": 5, }, Object { - "$ref": 8, + "$ref": 13, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1555,15 +1598,42 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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": 3, + "$ref": 1, }, }, "variableScope": Object { @@ -1571,7 +1641,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -1610,44 +1680,64 @@ 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 [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, "variableMap": Object { "Bar": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -1657,46 +1747,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 5, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -1743,10 +1793,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1882,6 +1933,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -1989,13 +2041,15 @@ Object { }, ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 13, }, "variableMap": Object { - "A": Object { - "$ref": 2, - }, "s1": Object { "$ref": 0, }, @@ -2174,6 +2228,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2309,6 +2364,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -2416,13 +2472,15 @@ Object { }, ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 13, }, "variableMap": Object { - "A": Object { - "$ref": 2, - }, "s1": Object { "$ref": 0, }, @@ -2601,6 +2659,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2646,6 +2705,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2726,6 +2786,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -2790,6 +2851,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2913,17 +2975,19 @@ Object { "$ref": 4, }, ], - "type": "empty-function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { + "type": "empty-function", + "typeMap": Object { "Key": Object { "$ref": 1, }, "Value": Object { "$ref": 2, }, + }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { "subject": Object { "$ref": 3, }, @@ -3076,6 +3140,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -3140,6 +3205,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3205,6 +3271,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3220,6 +3287,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "C": Object { @@ -3340,6 +3408,7 @@ Object { ], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3504,6 +3573,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3577,6 +3647,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3654,6 +3725,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -3689,6 +3761,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3753,6 +3826,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3817,6 +3891,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3894,6 +3969,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3972,6 +4048,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4036,6 +4113,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4100,6 +4178,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4177,6 +4256,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -4212,6 +4292,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4276,6 +4357,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4340,6 +4422,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4417,6 +4500,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4495,6 +4579,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4559,6 +4644,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4623,6 +4709,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4700,6 +4787,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4778,6 +4866,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4842,6 +4931,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4906,6 +4996,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4951,6 +5042,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 18, }, @@ -5044,6 +5136,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -5147,6 +5240,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 18, }, @@ -5197,6 +5291,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 17, }, @@ -5274,6 +5369,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 18, }, @@ -5354,6 +5450,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 19, }, @@ -5511,6 +5608,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5635,16 +5733,18 @@ Object { }, ], "type": "empty-function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { + "typeMap": Object { "Key": Object { "$ref": 1, }, "Value": Object { "$ref": 2, }, + }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { "subject": Object { "$ref": 3, }, @@ -5797,6 +5897,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -5861,6 +5962,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6066,6 +6168,7 @@ Object { }, ], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -6256,6 +6359,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 15, }, @@ -6375,6 +6479,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6446,6 +6551,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -6510,6 +6616,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -6570,6 +6677,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6627,6 +6735,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -6646,6 +6755,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6703,6 +6813,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -6722,6 +6833,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6953,6 +7065,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 17, }, @@ -7301,6 +7414,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7346,6 +7460,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -7370,6 +7485,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -7439,6 +7555,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -7513,6 +7630,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -7573,6 +7691,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7618,6 +7737,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7642,6 +7762,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7702,6 +7823,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -7762,6 +7884,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7839,6 +7962,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -7917,6 +8041,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -7981,6 +8106,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -8045,6 +8171,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8090,6 +8217,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -8138,6 +8266,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -8252,6 +8381,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -8287,10 +8417,7 @@ Object { ], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 0, }, @@ -8300,6 +8427,11 @@ Object { "C": Object { "$ref": 2, }, + }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { "a": Object { "$ref": 3, }, @@ -8504,6 +8636,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8539,6 +8672,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -8599,6 +8733,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8634,6 +8769,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -8649,6 +8785,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8694,6 +8831,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -8742,6 +8880,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -8777,10 +8916,7 @@ Object { ], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { + "typeMap": Object { "C": Object { "$ref": 1, }, @@ -8791,6 +8927,10 @@ Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -8957,6 +9097,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9026,6 +9167,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -9083,6 +9225,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -9199,6 +9342,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9254,6 +9398,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -9372,6 +9517,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -9482,6 +9628,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -9605,6 +9752,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9706,6 +9854,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9783,6 +9932,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9873,6 +10023,7 @@ Object { ], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -10010,6 +10161,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -10130,6 +10282,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10175,6 +10328,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -10249,6 +10403,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -10309,6 +10464,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10354,6 +10510,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -10369,14 +10526,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -10429,6 +10587,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10474,6 +10633,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -10554,6 +10714,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -10635,6 +10796,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -10715,13 +10877,15 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + }, "upperScope": Object { "$ref": 13, }, "variableMap": Object { - "A": Object { - "$ref": 0, - }, "C": Object { "$ref": 2, }, @@ -10877,6 +11041,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10922,6 +11087,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -11069,14 +11235,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 8, }, @@ -11149,6 +11316,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11194,13 +11362,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -11268,6 +11438,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11328,6 +11499,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11410,6 +11582,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -11484,6 +11657,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11551,6 +11725,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -11586,6 +11761,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11650,6 +11826,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11719,6 +11896,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11760,13 +11938,15 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "B": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "B": Object { - "$ref": 1, - }, "obj": Object { "$ref": 0, }, @@ -11876,6 +12056,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12068,6 +12249,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -12157,6 +12339,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12454,14 +12637,15 @@ Object { }, ], "type": "interface", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 3, }, }, + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 17, }, @@ -12587,13 +12771,15 @@ Object { }, ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 18, }, "variableMap": Object { - "A": Object { - "$ref": 1, - }, "obj": Object { "$ref": 0, }, @@ -12731,6 +12917,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12796,6 +12983,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -12874,6 +13062,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -12934,6 +13123,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13018,13 +13208,15 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -13143,6 +13335,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -13203,6 +13396,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13396,6 +13590,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -13634,6 +13829,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13679,6 +13875,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -13694,14 +13891,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -13754,6 +13952,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13789,6 +13988,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -13855,6 +14055,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13890,6 +14091,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -13956,6 +14158,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14033,6 +14236,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -14106,6 +14310,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14369,14 +14574,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 14, }, @@ -14464,14 +14670,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { + "typeMap": Object { "Unpacked": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 14, }, @@ -14546,6 +14753,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14653,14 +14861,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -14720,14 +14929,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "LinkedList": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -14784,6 +14994,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14841,6 +15052,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -14911,6 +15123,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14968,6 +15181,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15038,6 +15252,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15095,6 +15310,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15165,6 +15381,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15222,6 +15439,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15292,6 +15510,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15337,6 +15556,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -15352,14 +15572,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -15412,6 +15633,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15457,6 +15679,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -15472,14 +15695,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -15532,6 +15756,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15589,6 +15814,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15659,6 +15885,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15716,6 +15943,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15786,6 +16014,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15863,6 +16092,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -15936,6 +16166,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15971,6 +16202,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16037,6 +16269,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16072,6 +16305,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16138,6 +16372,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16173,6 +16408,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16239,6 +16475,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16274,6 +16511,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16340,6 +16578,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16385,6 +16624,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16400,14 +16640,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -16460,6 +16701,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16495,6 +16737,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16561,6 +16804,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16618,6 +16862,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -16737,6 +16982,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16794,6 +17040,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -16864,6 +17111,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16899,6 +17147,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17112,6 +17361,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17157,6 +17407,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -17172,14 +17423,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -17232,6 +17484,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17287,6 +17540,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17365,6 +17619,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "foo": Object { @@ -17445,6 +17700,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -17505,6 +17761,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "A": Object { @@ -17582,15 +17839,101 @@ 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": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 6, + "$ref": 1, }, }, "variableScope": Object { @@ -17598,7 +17941,7 @@ Object { }, "variables": Array [ Object { - "$id": 6, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -17637,101 +17980,72 @@ 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 [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Component", - "range": Array [ - 31, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Nullable", - "range": Array [ - 41, - 49, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "SomeOther", - "range": Array [ - 50, - 59, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Component2", - "range": Array [ - 67, - 77, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, Object { - "$ref": 4, + "$ref": 5, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "Nullable": Object { "$ref": 0, }, }, @@ -17741,50 +18055,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": true, - "identifiers": Array [ - Object { - "name": "Nullable", - "range": Array [ - 10, - 18, - ], - "type": "Identifier", - }, - ], - "name": "Nullable", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -17899,6 +18169,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -18006,6 +18277,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "A": Object { @@ -18131,7 +18403,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, @@ -18142,15 +18414,38 @@ 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": 15, }, "variableMap": Object { "Foo": Object { - "$ref": 9, + "$ref": 6, }, }, "variableScope": Object { @@ -18158,7 +18453,7 @@ Object { }, "variables": Array [ Object { - "$id": 9, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -18194,13 +18489,13 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 8, }, }, ], }, Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 42, @@ -18211,15 +18506,38 @@ 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": 15, }, "variableMap": Object { "Foo2": Object { - "$ref": 11, + "$ref": 9, }, }, "variableScope": Object { @@ -18227,7 +18545,7 @@ Object { }, "variables": Array [ Object { - "$id": 11, + "$id": 9, "defs": Array [ Object { "name": Object { @@ -18263,7 +18581,7 @@ Object { "name": "Foo2", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 11, }, }, ], @@ -18280,15 +18598,38 @@ 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": 15, }, "variableMap": Object { "Foo3": Object { - "$ref": 13, + "$ref": 12, }, }, "variableScope": Object { @@ -18296,7 +18637,7 @@ Object { }, "variables": Array [ Object { - "$id": 13, + "$id": 12, "defs": Array [ Object { "name": Object { @@ -18346,23 +18687,6 @@ Object { "from": Object { "$ref": 15, }, - "identifier": Object { - "name": "Baz", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 15, - }, "identifier": Object { "name": "Bar", "range": Array [ @@ -18376,24 +18700,7 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, - "from": Object { - "$ref": 15, - }, - "identifier": Object { - "name": "Baz", - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, + "$id": 4, "from": Object { "$ref": 15, }, @@ -18410,24 +18717,7 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, - "from": Object { - "$ref": 15, - }, - "identifier": Object { - "name": "Baz", - "range": Array [ - 107, - 110, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 8, + "$id": 5, "from": Object { "$ref": 15, }, @@ -18449,22 +18739,23 @@ Object { "$ref": 3, }, Object { - "$ref": 4, + "$ref": 7, }, Object { - "$ref": 5, + "$ref": 4, }, Object { - "$ref": 6, + "$ref": 10, }, Object { - "$ref": 7, + "$ref": 5, }, Object { - "$ref": 8, + "$ref": 13, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { @@ -18628,15 +18919,42 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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": 3, + "$ref": 1, }, }, "variableScope": Object { @@ -18644,7 +18962,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -18683,42 +19001,62 @@ 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 [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Bar": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -18728,46 +19066,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": true, - "identifiers": Array [ - Object { - "name": "T", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "T", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -18926,6 +19224,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -19033,11 +19332,13 @@ Object { }, ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 2, }, + }, + "upperScope": null, + "variableMap": Object { "s1": Object { "$ref": 0, }, @@ -19184,7 +19485,7 @@ Object { "type": "InterfaceName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "A", @@ -19321,6 +19622,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -19428,11 +19730,13 @@ Object { }, ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 2, }, + }, + "upperScope": null, + "variableMap": Object { "s1": Object { "$ref": 0, }, @@ -19579,7 +19883,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "A", @@ -19626,6 +19930,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -19706,6 +20011,7 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "f": Object { @@ -19869,16 +20175,18 @@ Object { }, ], "type": "empty-function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { + "typeMap": Object { "Key": Object { "$ref": 1, }, "Value": Object { "$ref": 2, }, + }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { "subject": Object { "$ref": 3, }, @@ -20031,6 +20339,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "eachr": Object { @@ -20127,6 +20436,7 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "C": Object { @@ -20237,6 +20547,7 @@ Object { ], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -20401,6 +20712,7 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "a": Object { @@ -20526,6 +20838,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -20561,6 +20874,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -20625,6 +20939,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { @@ -20737,6 +21052,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -20815,6 +21131,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -20879,6 +21196,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { @@ -20991,6 +21309,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -21026,6 +21345,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -21090,6 +21410,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { @@ -21202,6 +21523,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -21280,6 +21602,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -21344,6 +21667,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { @@ -21456,6 +21780,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -21534,6 +21859,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -21598,6 +21924,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { @@ -21678,6 +22005,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 18, }, @@ -21771,6 +22099,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -21874,6 +22203,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 18, }, @@ -21924,6 +22254,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 17, }, @@ -22001,6 +22332,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 18, }, @@ -22081,6 +22413,7 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "C": Object { @@ -22337,16 +22670,18 @@ Object { }, ], "type": "empty-function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { + "typeMap": Object { "Key": Object { "$ref": 1, }, "Value": Object { "$ref": 2, }, + }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { "subject": Object { "$ref": 3, }, @@ -22499,6 +22834,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "eachr": Object { @@ -22739,6 +23075,7 @@ Object { }, ], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -22929,6 +23266,7 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "E": Object { @@ -23094,6 +23432,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -23158,6 +23497,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { @@ -23250,6 +23590,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23297,6 +23638,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23518,6 +23860,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "a": Object { @@ -23873,6 +24216,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -23897,6 +24241,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -23966,6 +24311,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -24040,6 +24386,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "f": Object { @@ -24120,6 +24467,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -24144,6 +24492,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -24204,6 +24553,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "f": Object { @@ -24316,6 +24666,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -24394,6 +24745,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -24458,6 +24810,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Test": Object { @@ -24538,6 +24891,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -24574,9 +24928,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], @@ -24586,6 +24938,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -24622,9 +24975,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -24660,9 +25011,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -24679,9 +25028,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], @@ -24700,6 +25047,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -24727,16 +25075,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 4, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 0, }, @@ -24746,6 +25107,9 @@ Object { "C": Object { "$ref": 2, }, + }, + "upperScope": null, + "variableMap": Object { "a": Object { "$ref": 3, }, @@ -24777,7 +25141,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "A", @@ -24789,17 +25153,7 @@ Object { }, ], "name": "A", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, - ], + "references": Array [], "scope": Object { "$ref": 13, }, @@ -24827,7 +25181,7 @@ Object { "type": "InterfaceName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "B", @@ -24839,11 +25193,7 @@ Object { }, ], "name": "B", - "references": Array [ - Object { - "$ref": 8, - }, - ], + "references": Array [], "scope": Object { "$ref": 13, }, @@ -24871,7 +25221,7 @@ Object { "type": "InterfaceName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "C", @@ -24883,11 +25233,7 @@ Object { }, ], "name": "C", - "references": Array [ - Object { - "$ref": 4, - }, - ], + "references": Array [], "scope": Object { "$ref": 13, }, @@ -24962,6 +25308,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "foo": Object { @@ -25032,6 +25379,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25067,6 +25415,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -25103,9 +25452,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], @@ -25115,6 +25462,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -25142,16 +25490,20 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "C": Object { "$ref": 1, }, @@ -25162,6 +25514,8 @@ Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -25208,7 +25562,7 @@ Object { "type": "TypeParameter", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "T", @@ -25256,7 +25610,7 @@ Object { "type": "InterfaceName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "C", @@ -25268,14 +25622,7 @@ Object { }, ], "name": "C", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], + "references": Array [], "scope": Object { "$ref": 7, }, @@ -25303,7 +25650,7 @@ Object { "type": "InterfaceName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "R", @@ -25374,6 +25721,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25431,6 +25779,7 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "Foo": Object { @@ -25577,6 +25926,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -25695,6 +26045,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -25805,6 +26156,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "A": Object { @@ -25997,6 +26349,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "foo": Object { @@ -26135,6 +26488,7 @@ Object { ], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -26272,6 +26626,7 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "N": Object { @@ -26412,6 +26767,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -26486,6 +26842,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "foo": Object { @@ -26566,6 +26923,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -26581,12 +26939,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -26614,7 +26973,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "foo", @@ -26661,6 +27020,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -26707,9 +27067,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -26726,9 +27084,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], @@ -26741,6 +27097,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -26822,6 +27179,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -26894,19 +27252,29 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 0, }, + }, + "upperScope": null, + "variableMap": Object { "C": Object { "$ref": 2, }, @@ -26941,7 +27309,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "A", @@ -26953,17 +27321,7 @@ Object { }, ], "name": "A", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - ], + "references": Array [], "scope": Object { "$ref": 12, }, @@ -27084,6 +27442,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -27134,9 +27493,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -27210,9 +27567,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], @@ -27220,6 +27575,9 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -27229,14 +27587,18 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 8, }, @@ -27264,7 +27626,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "A", @@ -27276,14 +27638,7 @@ Object { }, ], "name": "A", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], + "references": Array [], "scope": Object { "$ref": 8, }, @@ -27318,13 +27673,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -27392,6 +27749,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "f": Object { @@ -27509,6 +27867,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "a": Object { @@ -27621,6 +27980,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -27656,6 +28016,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "test": Object { @@ -27760,6 +28121,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27801,11 +28163,13 @@ Object { ], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "B": Object { "$ref": 1, }, + }, + "upperScope": null, + "variableMap": Object { "obj": Object { "$ref": 0, }, @@ -27890,7 +28254,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "B", @@ -28084,6 +28448,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "obj": Object { @@ -28432,14 +28797,15 @@ Object { }, ], "type": "interface", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 3, }, }, + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 17, }, @@ -28565,11 +28931,13 @@ Object { }, ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 1, }, + }, + "upperScope": null, + "variableMap": Object { "obj": Object { "$ref": 0, }, @@ -28669,7 +29037,7 @@ Object { "type": "InterfaceName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "A", @@ -28736,6 +29104,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28814,6 +29183,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "f": Object { @@ -28933,13 +29303,15 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -29058,6 +29430,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "g": Object { @@ -29286,6 +29659,7 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "element": Object { @@ -29544,6 +29918,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -29559,12 +29934,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -29592,7 +29968,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "Foo", @@ -29629,6 +30005,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -29705,6 +30082,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -29823,6 +30201,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -30127,14 +30506,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 14, }, @@ -30222,12 +30602,13 @@ Object { }, ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "Unpacked": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 14, }, @@ -30255,7 +30636,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "Unpacked", @@ -30333,9 +30714,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -30364,14 +30743,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -30429,14 +30809,19 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "LinkedList": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -30464,7 +30849,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "LinkedList", @@ -30476,11 +30861,7 @@ Object { }, ], "name": "LinkedList", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "references": Array [], "scope": Object { "$ref": 6, }, @@ -30527,6 +30908,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -30625,6 +31007,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -30723,6 +31106,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -30821,6 +31205,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -30907,6 +31292,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -30922,12 +31308,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -30955,7 +31342,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "Foo", @@ -31002,6 +31389,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31017,12 +31405,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -31050,7 +31439,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "Foo", @@ -31109,6 +31498,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -31207,6 +31597,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -31325,6 +31716,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -31401,6 +31793,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -31477,6 +31870,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -31553,6 +31947,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -31629,6 +32024,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -31715,6 +32111,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31730,12 +32127,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -31763,7 +32161,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "Foo", @@ -31800,6 +32198,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "obj": Object { @@ -31898,6 +32297,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -32045,6 +32445,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -32121,6 +32522,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "intersection": Object { @@ -32354,6 +32756,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -32369,12 +32772,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -32402,7 +32806,7 @@ Object { "type": "TypeAliasName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "Foo", diff --git a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap index eade98ea309d..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 { @@ -136,6 +140,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -203,6 +208,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -281,6 +287,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Props": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 10, }, @@ -288,9 +299,6 @@ Object { "App": Object { "$ref": 2, }, - "Props": Object { - "$ref": 1, - }, "React": Object { "$ref": 0, }, @@ -437,6 +445,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index 65fe153afbb5..c6d0af35226d 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -36,13 +36,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -110,6 +112,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -170,6 +173,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -215,13 +219,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -289,6 +295,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -349,6 +356,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -394,6 +402,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -454,6 +463,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -514,6 +524,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -581,6 +592,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -645,6 +657,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -709,6 +722,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -754,6 +768,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -814,6 +829,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -874,6 +890,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -919,6 +936,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -979,6 +997,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1039,6 +1058,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1084,6 +1104,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1144,6 +1165,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1204,6 +1226,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1249,6 +1272,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1309,6 +1333,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1369,6 +1394,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1436,6 +1462,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1500,6 +1527,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -1564,6 +1592,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1609,6 +1638,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1624,14 +1654,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "I": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -1684,6 +1715,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1745,6 +1777,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1815,6 +1848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1880,6 +1914,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -1970,6 +2005,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -2040,6 +2076,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2105,6 +2142,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2169,6 +2207,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2184,6 +2223,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2287,13 +2327,15 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 0, + }, + }, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "X": Object { - "$ref": 0, - }, "b": Object { "$ref": 1, }, @@ -2401,6 +2443,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -2416,6 +2459,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2471,6 +2515,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2502,6 +2547,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function-expression-name", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2562,6 +2608,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -2577,6 +2624,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2698,6 +2746,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -2888,6 +2937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -2948,6 +2998,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3059,6 +3110,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3150,6 +3202,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3214,6 +3267,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3301,6 +3355,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3323,14 +3378,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, @@ -3390,6 +3446,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3477,14 +3534,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 5, }, @@ -3571,14 +3629,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 5, }, @@ -3638,6 +3697,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3715,6 +3775,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3737,6 +3798,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3814,6 +3876,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -3836,6 +3899,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3893,6 +3957,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -3912,6 +3977,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3969,6 +4035,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -3988,6 +4055,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4070,6 +4138,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -4144,6 +4213,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4189,6 +4259,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -4271,6 +4342,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -4335,6 +4407,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4380,6 +4453,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -4462,6 +4536,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -4526,6 +4601,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4581,6 +4657,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4641,6 +4718,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4719,6 +4797,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -4779,6 +4858,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -4839,6 +4919,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4894,6 +4975,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4934,6 +5016,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4965,6 +5048,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -5025,6 +5109,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -5085,6 +5170,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5140,6 +5226,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -5180,6 +5267,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -5211,6 +5299,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -5271,6 +5360,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -5331,6 +5421,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5386,13 +5477,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, @@ -5469,13 +5562,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "T": Object { - "$ref": 6, - }, "arguments": Object { "$ref": 5, }, @@ -5543,6 +5638,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -5603,6 +5699,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -5663,6 +5760,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5708,6 +5806,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -5768,6 +5867,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -5828,6 +5928,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5873,6 +5974,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -5933,6 +6035,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -5993,6 +6096,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6048,6 +6152,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -6122,6 +6227,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -6182,6 +6288,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -6242,6 +6349,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6284,15 +6392,38 @@ 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": 5, }, "variableMap": Object { "ClassWithParentAndInterface": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { @@ -6300,7 +6431,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -6350,23 +6481,6 @@ Object { "from": Object { "$ref": 5, }, - "identifier": Object { - "name": "MyInterface", - "range": Array [ - 66, - 77, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, "identifier": Object { "name": "MyOtherClass", "range": Array [ @@ -6385,10 +6499,11 @@ Object { "$ref": 1, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -6452,10 +6567,11 @@ Object { "$ref": 1, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6498,15 +6614,42 @@ 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": 6, }, "variableMap": Object { "Foo": Object { - "$ref": 4, + "$ref": 2, }, }, "variableScope": Object { @@ -6514,7 +6657,7 @@ Object { }, "variables": Array [ Object { - "$id": 4, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -6553,6 +6696,46 @@ Object { "$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, + }, + }, ], }, ], @@ -6560,24 +6743,7 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "B", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, + "$id": 1, "from": Object { "$ref": 6, }, @@ -6596,22 +6762,20 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, Object { - "$ref": 3, + "$ref": 4, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "A": Object { - "$ref": 0, - }, "Foo": Object { - "$ref": 1, + "$ref": 0, }, }, "variableScope": Object { @@ -6620,46 +6784,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 6, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -6706,13 +6830,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, Object { - "$ref": 3, + "$ref": 4, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6755,15 +6880,82 @@ 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": 8, }, "variableMap": Object { "Foo": Object { - "$ref": 6, + "$ref": 2, }, }, "variableScope": Object { @@ -6771,7 +6963,7 @@ Object { }, "variables": Array [ Object { - "$id": 6, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -6810,6 +7002,46 @@ Object { "$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, + }, + }, ], }, ], @@ -6817,58 +7049,7 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "B", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "D", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, + "$id": 1, "from": Object { "$ref": 8, }, @@ -6887,10 +7068,7 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "$ref": 1, }, Object { "$ref": 4, @@ -6898,17 +7076,18 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, "variableMap": Object { - "A": Object { - "$ref": 0, - }, "Foo": Object { - "$ref": 1, + "$ref": 0, }, }, "variableScope": Object { @@ -6917,46 +7096,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 8, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -7003,10 +7142,7 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "$ref": 1, }, Object { "$ref": 4, @@ -7014,8 +7150,12 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7071,13 +7211,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, @@ -7145,6 +7287,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -7205,6 +7348,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -7265,6 +7409,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7342,13 +7487,15 @@ Object { }, ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, @@ -7420,6 +7567,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -7484,6 +7632,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -7548,6 +7697,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7590,15 +7740,38 @@ 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": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { @@ -7606,7 +7779,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -7650,31 +7823,14 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -7735,10 +7891,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7781,15 +7938,38 @@ 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": 5, }, "variableMap": Object { "ClassWithParentAndInterface": Object { - "$ref": 3, + "$ref": 2, }, }, "variableScope": Object { @@ -7797,7 +7977,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -7847,23 +8027,6 @@ Object { "from": Object { "$ref": 5, }, - "identifier": Object { - "name": "MyInterface", - "range": Array [ - 45, - 56, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, "identifier": Object { "name": "MyOtherClass", "range": Array [ @@ -7882,10 +8045,11 @@ Object { "$ref": 1, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -7949,10 +8113,11 @@ Object { "$ref": 1, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7995,15 +8160,58 @@ 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": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 3, + "$ref": 1, }, }, "variableScope": Object { @@ -8011,7 +8219,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -8055,51 +8263,17 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "S", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -8160,13 +8334,14 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8209,15 +8384,78 @@ 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": 6, }, "variableMap": Object { "Foo": Object { - "$ref": 4, + "$ref": 1, }, }, "variableScope": Object { @@ -8225,7 +8463,7 @@ Object { }, "variables": Array [ Object { - "$id": 4, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -8269,71 +8507,20 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "S", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "T", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, Object { "$ref": 3, }, + Object { + "$ref": 4, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -8393,17 +8580,18 @@ Object { "isStrict": false, "references": 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 { @@ -8459,6 +8647,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -8499,13 +8688,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 5, + }, + }, "upperScope": Object { "$ref": 9, }, "variableMap": Object { - "T": Object { - "$ref": 5, - }, "arguments": Object { "$ref": 4, }, @@ -8582,6 +8773,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -8613,6 +8805,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -8673,6 +8866,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -8733,6 +8927,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8764,7 +8959,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 15, + "$id": 14, "block": Object { "range": Array [ 0, @@ -8774,7 +8969,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 13, "block": Object { "range": Array [ 60, @@ -8788,12 +8983,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 15, + "$ref": 14, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [], }, @@ -8802,9 +8998,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 11, + "$id": 10, "from": Object { - "$ref": 15, + "$ref": 14, }, "identifier": Object { "name": "Constructor", @@ -8821,9 +9017,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 11, "from": Object { - "$ref": 15, + "$ref": 14, }, "identifier": Object { "name": "T", @@ -8835,14 +9031,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 9, + "$ref": 8, }, "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 12, "from": Object { - "$ref": 15, + "$ref": 14, }, "identifier": Object { "name": "Base", @@ -8854,48 +9050,50 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 10, + "$ref": 9, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 11, + "$ref": 10, }, ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 8, + }, + }, "upperScope": Object { "$ref": 25, }, "variableMap": Object { "Base": Object { - "$ref": 10, - }, - "T": Object { "$ref": 9, }, "arguments": Object { - "$ref": 8, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [ Object { - "$id": 8, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 15, + "$ref": 14, }, }, Object { - "$id": 9, + "$id": 8, "defs": Array [ Object { "name": Object { @@ -8931,15 +9129,15 @@ Object { "name": "T", "references": Array [ Object { - "$ref": 12, + "$ref": 11, }, ], "scope": Object { - "$ref": 15, + "$ref": 14, }, }, Object { - "$id": 10, + "$id": 9, "defs": Array [ Object { "name": Object { @@ -8975,11 +9173,11 @@ Object { "name": "Base", "references": Array [ Object { - "$ref": 13, + "$ref": 12, }, ], "scope": Object { - "$ref": 15, + "$ref": 14, }, }, ], @@ -8996,15 +9194,40 @@ 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": 25, }, "variableMap": Object { "X": Object { - "$ref": 16, + "$ref": 15, }, }, "variableScope": Object { @@ -9012,7 +9235,7 @@ Object { }, "variables": Array [ Object { - "$id": 16, + "$id": 15, "defs": Array [ Object { "name": Object { @@ -9068,6 +9291,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 25, }, @@ -9137,6 +9361,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 25, }, @@ -9202,14 +9427,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 25, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 21, }, }, + "upperScope": Object { + "$ref": 25, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 25, }, @@ -9269,25 +9495,6 @@ Object { "from": Object { "$ref": 25, }, - "identifier": Object { - "name": "I", - "range": Array [ - 123, - 124, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 25, - }, "identifier": Object { "name": "M", "range": Array [ @@ -9303,7 +9510,7 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 6, "from": Object { "$ref": 25, }, @@ -9328,6 +9535,14 @@ Object { }, ], "type": "module", + "typeMap": Object { + "Constructor": Object { + "$ref": 4, + }, + "I": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 26, }, @@ -9335,12 +9550,6 @@ Object { "C": Object { "$ref": 2, }, - "Constructor": Object { - "$ref": 4, - }, - "I": Object { - "$ref": 3, - }, "M": Object { "$ref": 0, }, @@ -9389,7 +9598,7 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 6, + "$ref": 5, }, ], "scope": Object { @@ -9473,7 +9682,7 @@ Object { "name": "C", "references": Array [ Object { - "$ref": 7, + "$ref": 6, }, ], "scope": Object { @@ -9517,7 +9726,7 @@ Object { "name": "I", "references": Array [ Object { - "$ref": 5, + "$ref": 16, }, ], "scope": Object { @@ -9561,7 +9770,7 @@ Object { "name": "Constructor", "references": Array [ Object { - "$ref": 11, + "$ref": 10, }, ], "scope": Object { @@ -9580,6 +9789,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9688,6 +9898,11 @@ Object { }, ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 8, }, @@ -9695,9 +9910,6 @@ Object { "Base": Object { "$ref": 3, }, - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -9813,6 +10025,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -9881,6 +10094,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9948,6 +10162,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -10012,6 +10227,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -10076,6 +10292,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10121,6 +10338,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -10181,6 +10399,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -10241,6 +10460,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10332,6 +10552,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -10443,6 +10664,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -10615,6 +10837,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10682,6 +10905,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -10746,6 +10970,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -10810,6 +11035,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10916,6 +11142,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -11127,6 +11354,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -11187,6 +11415,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -11247,6 +11476,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11302,6 +11532,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11348,6 +11579,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11367,6 +11599,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11431,6 +11664,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11495,6 +11729,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11562,6 +11797,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -11626,6 +11862,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11690,6 +11927,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11796,6 +12034,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -12007,6 +12246,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -12067,6 +12307,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -12127,6 +12368,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12233,6 +12475,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -12444,6 +12687,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -12504,6 +12748,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -12564,6 +12809,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12645,6 +12891,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -12766,6 +13013,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -12826,6 +13074,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -12886,6 +13135,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12931,6 +13181,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -12991,6 +13242,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13051,6 +13303,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13106,6 +13359,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -13180,6 +13434,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -13240,6 +13495,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -13300,6 +13556,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13355,13 +13612,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, @@ -13438,13 +13697,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "T": Object { - "$ref": 6, - }, "arguments": Object { "$ref": 5, }, @@ -13512,6 +13773,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -13572,6 +13834,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -13632,6 +13895,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13677,12 +13941,17 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { @@ -13690,7 +13959,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -13729,6 +13998,46 @@ Object { "$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, + }, + }, ], }, ], @@ -13737,14 +14046,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -13754,46 +14061,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 4, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -13840,6 +14107,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13882,15 +14150,42 @@ 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": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 3, + "$ref": 1, }, }, "variableScope": Object { @@ -13898,7 +14193,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -13937,44 +14232,64 @@ Object { "$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, + }, + }, ], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -13984,46 +14299,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 5, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -14070,10 +14345,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14119,12 +14395,17 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "__P": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 4, }, "variableMap": Object { "A": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { @@ -14132,7 +14413,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -14171,6 +14452,46 @@ Object { "$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, + }, + }, ], }, ], @@ -14179,14 +14500,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { "A": Object { - "$ref": 1, - }, - "__P": Object { "$ref": 0, }, }, @@ -14196,46 +14515,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 4, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -14282,6 +14561,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14589,6 +14869,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 16, }, @@ -14892,6 +15173,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14963,6 +15245,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15070,6 +15353,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15130,6 +15414,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15175,6 +15460,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15235,6 +15521,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -15295,6 +15582,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15340,6 +15628,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -15400,6 +15689,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -15460,6 +15750,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15570,6 +15861,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -15595,6 +15887,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15892,6 +16185,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -15938,6 +16232,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16048,6 +16343,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -16073,6 +16369,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16191,6 +16488,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -16276,6 +16574,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -16340,6 +16639,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16415,6 +16715,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -16430,6 +16731,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16543,6 +16845,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16618,6 +16921,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -16633,6 +16937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16746,6 +17051,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16803,6 +17109,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16822,6 +17129,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16879,6 +17187,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16898,6 +17207,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16969,6 +17279,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17076,6 +17387,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17136,6 +17448,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17207,6 +17520,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17314,6 +17628,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17374,6 +17689,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17419,6 +17735,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 0, + }, + }, "upperScope": Object { "$ref": 2, }, @@ -17426,7 +17747,48 @@ Object { "variableScope": Object { "$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, @@ -17434,59 +17796,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, - "variableMap": Object { - "T": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, - "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": 2, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -17494,6 +17812,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17539,6 +17858,14 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 0, + }, + "U": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 3, }, @@ -17546,7 +17873,88 @@ Object { "variableScope": Object { "$ref": 3, }, - "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, + 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": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + ], + "name": "U", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -17554,102 +17962,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, - "variableMap": Object { - "T": Object { - "$ref": 0, - }, - "U": Object { - "$ref": 1, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 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": 3, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "U", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 20, - 26, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "U", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - ], - "name": "U", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -17657,6 +17978,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17702,12 +18024,17 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { @@ -17715,7 +18042,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -17754,6 +18081,46 @@ Object { "$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, + }, + }, ], }, ], @@ -17762,14 +18129,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -17779,46 +18144,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 4, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -17865,6 +18190,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17910,12 +18236,20 @@ Object { "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": 3, + "$ref": 1, }, }, "variableScope": Object { @@ -17923,7 +18257,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -17962,6 +18296,86 @@ 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, + }, + }, ], }, ], @@ -17970,19 +18384,14 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, "variableMap": Object { "Foo": Object { - "$ref": 2, - }, - "T": Object { "$ref": 0, }, - "U": Object { - "$ref": 1, - }, }, "variableScope": Object { "$ref": 5, @@ -17990,86 +18399,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 5, - }, - }, - Object { - "$id": 1, - "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": 5, - }, - }, - Object { - "$id": 2, "defs": Array [ Object { "name": Object { @@ -18116,6 +18445,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18187,6 +18517,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -18294,6 +18625,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -18354,6 +18686,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18399,6 +18732,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -18414,6 +18748,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -18474,6 +18809,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18519,6 +18855,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -18534,6 +18871,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -18594,6 +18932,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18639,6 +18978,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -18699,6 +19039,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -18759,6 +19100,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18804,6 +19146,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -18819,14 +19162,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "TestAlias": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -18879,6 +19223,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18924,6 +19269,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -18939,14 +19285,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "TestClassProps": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -18999,6 +19346,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19066,6 +19414,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -19085,14 +19434,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "TestCallback": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -19149,6 +19499,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19214,13 +19565,15 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "a": Object { "$ref": 4, }, @@ -19361,6 +19714,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -19431,6 +19785,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19476,6 +19831,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -19533,6 +19889,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -19603,6 +19960,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19648,6 +20006,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -19717,6 +20076,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -19806,6 +20166,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -19884,6 +20245,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -19944,6 +20306,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20009,6 +20372,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -20087,6 +20451,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -20147,6 +20512,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20192,6 +20558,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -20309,6 +20676,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -20369,6 +20737,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20414,6 +20783,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -20531,6 +20901,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -20591,6 +20962,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20694,13 +21066,15 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "X": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -20822,6 +21196,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -20882,6 +21257,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20927,13 +21303,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -21001,6 +21379,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -21061,6 +21440,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21164,13 +21544,15 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "X": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -21292,6 +21674,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -21352,6 +21735,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21417,6 +21801,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -21495,6 +21880,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -21555,6 +21941,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21666,6 +22053,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -21838,6 +22226,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -21902,6 +22291,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22029,6 +22419,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -22159,6 +22550,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22194,6 +22586,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -22254,6 +22647,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22289,6 +22683,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -22349,6 +22744,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22394,6 +22790,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -22460,6 +22857,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -22482,10 +22880,7 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 0, }, @@ -22493,6 +22888,10 @@ Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -22592,6 +22991,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22679,6 +23079,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -22701,14 +23102,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "X": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, @@ -22768,6 +23170,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22835,6 +23238,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -22854,14 +23258,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -22918,6 +23323,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23005,6 +23411,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -23027,14 +23434,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, @@ -23094,6 +23502,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23139,6 +23548,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -23154,10 +23564,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 1, }, @@ -23165,6 +23572,10 @@ Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -23257,6 +23668,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23624,10 +24036,7 @@ Object { }, ], "type": "interface", - "upperScope": Object { - "$ref": 20, - }, - "variableMap": Object { + "typeMap": Object { "F": Object { "$ref": 2, }, @@ -23635,6 +24044,10 @@ Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 20, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 20, }, @@ -23776,14 +24189,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 21, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 21, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 20, }, @@ -23885,6 +24299,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23972,6 +24387,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -23994,14 +24410,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "Test": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, @@ -24061,6 +24478,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24128,6 +24546,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -24147,14 +24566,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -24211,6 +24631,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24298,6 +24719,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -24320,10 +24742,7 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 1, }, @@ -24331,6 +24750,10 @@ Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 5, }, @@ -24430,6 +24853,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24475,6 +24899,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -24490,10 +24915,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 0, }, @@ -24501,6 +24923,10 @@ Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -24593,6 +25019,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24660,6 +25087,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -24679,14 +25107,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Test": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -24743,6 +25172,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24868,14 +25298,15 @@ Object { }, ], "type": "interface", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -24942,14 +25373,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { + "typeMap": Object { "test": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -25009,6 +25441,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25116,6 +25549,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25141,14 +25575,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "test": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 5, }, @@ -25211,6 +25646,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25256,6 +25692,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -25271,14 +25708,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "test": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -25331,6 +25769,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25398,6 +25837,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -25417,14 +25857,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "x": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -25481,6 +25922,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25677,6 +26119,7 @@ Object { ], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 19, }, @@ -26012,6 +26455,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 20, }, @@ -26323,6 +26767,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26420,6 +26865,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26496,6 +26942,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26573,6 +27020,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -26646,6 +27094,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26691,6 +27140,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -26732,6 +27182,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -26802,6 +27253,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26952,6 +27404,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -27093,6 +27546,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -27160,6 +27614,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27195,6 +27650,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -27310,6 +27766,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27400,6 +27857,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27531,6 +27989,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -27591,6 +28050,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27636,6 +28096,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27676,6 +28137,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27736,6 +28198,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27796,6 +28259,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27841,13 +28305,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 13, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, @@ -27924,13 +28390,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { "$ref": 13, }, "variableMap": Object { - "T": Object { - "$ref": 6, - }, "arguments": Object { "$ref": 5, }, @@ -28007,6 +28475,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -28047,6 +28516,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -28147,6 +28617,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -28217,6 +28688,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28358,6 +28830,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -28448,6 +28921,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -28508,6 +28982,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28725,6 +29200,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -28827,6 +29303,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -28887,6 +29364,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29104,6 +29582,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -29206,6 +29685,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -29266,6 +29746,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29426,6 +29907,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -29519,6 +30001,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -29579,6 +30062,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29739,6 +30223,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -29832,6 +30317,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -29892,6 +30378,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30052,6 +30539,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -30145,6 +30633,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -30205,6 +30694,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30240,6 +30730,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -30255,6 +30746,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30360,6 +30852,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -30489,6 +30982,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -30574,6 +31068,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -30665,6 +31160,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30770,6 +31266,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -30855,6 +31352,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -30919,6 +31417,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30986,6 +31485,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31064,6 +31564,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31128,6 +31629,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31234,14 +31736,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -31305,14 +31808,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "Result": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -31372,6 +31876,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31478,14 +31983,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -31549,14 +32055,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "Result": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -31616,6 +32123,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31661,6 +32169,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31676,14 +32185,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -31736,6 +32246,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31801,6 +32312,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31891,6 +32403,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31961,6 +32474,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32026,6 +32540,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32104,6 +32619,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32164,6 +32680,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32251,6 +32768,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -32273,14 +32791,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "AssertFoo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, @@ -32340,6 +32859,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32395,6 +32915,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32435,6 +32956,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32450,6 +32972,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32510,6 +33033,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -32570,6 +33094,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32635,6 +33160,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32725,6 +33251,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32795,6 +33322,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32860,6 +33388,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32938,6 +33467,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32998,6 +33528,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33085,6 +33616,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -33107,14 +33639,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "AssertFoo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, @@ -33174,6 +33707,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33229,6 +33763,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33269,6 +33804,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33284,6 +33820,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33344,6 +33881,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33404,6 +33942,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33488,6 +34027,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33581,6 +34121,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33651,6 +34192,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33735,6 +34277,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33816,6 +34359,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33876,6 +34420,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33963,6 +34508,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -33985,14 +34531,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, @@ -34052,6 +34599,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34131,6 +34679,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34195,6 +34744,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34210,6 +34760,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -34277,6 +34828,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -34337,6 +34889,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34382,13 +34935,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "A": Object { + "$ref": 5, + }, + }, "upperScope": Object { "$ref": 11, }, "variableMap": Object { - "A": Object { - "$ref": 5, - }, "arguments": Object { "$ref": 4, }, @@ -34487,13 +35042,15 @@ Object { }, ], "type": "function", + "typeMap": Object { + "A": Object { + "$ref": 8, + }, + }, "upperScope": Object { "$ref": 11, }, "variableMap": Object { - "A": Object { - "$ref": 8, - }, "arguments": Object { "$ref": 7, }, @@ -34606,6 +35163,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -34719,6 +35277,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34730,7 +35289,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 20, + "$id": 22, "block": Object { "range": Array [ 0, @@ -34740,7 +35299,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 19, + "$id": 21, "block": Object { "range": Array [ 0, @@ -34761,23 +35320,48 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 8, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 8, + }, + }, "upperScope": Object { - "$ref": 19, + "$ref": 21, }, "variableMap": Object { "foo": Object { - "$ref": 9, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 21, }, "variables": Array [ Object { - "$id": 9, + "$id": 7, "defs": Array [ Object { "name": Object { @@ -34816,10 +35400,54 @@ Object { "$ref": 10, }, }, + Object { + "$id": 8, + "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": 9, + }, + ], + "scope": Object { + "$ref": 10, + }, + }, ], }, Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 75, @@ -34830,11 +35458,36 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 149, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 12, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 12, + }, + }, "upperScope": Object { - "$ref": 19, + "$ref": 21, }, "variableMap": Object { "foo2": Object { @@ -34842,7 +35495,7 @@ Object { }, }, "variableScope": Object { - "$ref": 19, + "$ref": 21, }, "variables": Array [ Object { @@ -34882,13 +35535,57 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 14, + }, + }, + Object { + "$id": 12, + "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": 13, + }, + ], + "scope": Object { + "$ref": 14, }, }, ], }, Object { - "$id": 15, + "$id": 17, "block": Object { "range": Array [ 165, @@ -34901,9 +35598,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 13, + "$id": 15, "from": Object { - "$ref": 15, + "$ref": 17, }, "identifier": Object { "name": "bar2", @@ -34920,9 +35617,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 16, "from": Object { - "$ref": 15, + "$ref": 17, }, "identifier": Object { "name": "A", @@ -34934,31 +35631,32 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 2, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 13, + "$ref": 15, }, Object { - "$ref": 14, + "$ref": 16, }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { - "$ref": 19, + "$ref": 21, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 19, + "$ref": 21, }, "variables": Array [], }, Object { - "$id": 18, + "$id": 20, "block": Object { "range": Array [ 245, @@ -34971,9 +35669,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 16, + "$id": 18, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { "name": "bar", @@ -34990,9 +35688,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 19, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { "name": "A", @@ -35004,26 +35702,27 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 2, }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 16, + "$ref": 18, }, Object { - "$ref": 17, + "$ref": 19, }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { - "$ref": 19, + "$ref": 21, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 19, + "$ref": 21, }, "variables": Array [], }, @@ -35034,26 +35733,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 19, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 19, + "$ref": 21, }, "identifier": Object { "name": "bar", @@ -35064,34 +35744,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 19, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 149, - 150, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 6, "from": Object { - "$ref": 19, + "$ref": 21, }, "identifier": Object { "name": "bar", @@ -35102,20 +35761,22 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "module", - "upperScope": Object { - "$ref": 20, - }, - "variableMap": Object { + "typeMap": Object { "A": Object { - "$ref": 0, + "$ref": 2, }, "bar": Object { "$ref": 3, @@ -35123,15 +35784,20 @@ Object { "bar2": Object { "$ref": 4, }, + }, + "upperScope": Object { + "$ref": 22, + }, + "variableMap": Object { "foo": Object { - "$ref": 1, + "$ref": 0, }, "foo2": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 21, }, "variables": Array [ Object { @@ -35139,42 +35805,84 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "foo", "range": Array [ - 22, - 23, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 10, - 34, + 0, + 74, ], - "type": "TSTypeParameterDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "TypeParameter", + "type": "ClassName", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 21, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { "name": Object { - "name": "A", + "name": "foo2", "range": Array [ - 98, - 99, + 81, + 85, ], "type": "Identifier", }, "node": Object { "range": Array [ - 86, - 124, + 75, + 164, ], - "type": "TSTypeParameterDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "TypeParameter", + "type": "ClassName", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo2", + "range": Array [ + 81, + 85, + ], + "type": "Identifier", + }, + ], + "name": "foo2", + "references": Array [], + "scope": Object { + "$ref": 21, + }, + }, + Object { + "$id": 2, + "defs": Array [ Object { "name": Object { "name": "A", @@ -35216,22 +35924,6 @@ Object { ], "eslintUsed": undefined, "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - Object { - "name": "A", - "range": Array [ - 98, - 99, - ], - "type": "Identifier", - }, Object { "name": "A", "range": Array [ @@ -35252,100 +35944,14 @@ Object { "name": "A", "references": Array [ Object { - "$ref": 5, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 14, - }, - Object { - "$ref": 17, - }, - ], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 74, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 75, - 164, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", + "$ref": 16, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "foo2", - "range": Array [ - 81, - 85, - ], - "type": "Identifier", + "$ref": 19, }, ], - "name": "foo2", - "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 21, }, }, Object { @@ -35385,17 +35991,11 @@ Object { "name": "bar", "references": Array [ Object { - "$ref": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 16, + "$ref": 18, }, ], "scope": Object { - "$ref": 19, + "$ref": 21, }, }, Object { @@ -35435,11 +36035,11 @@ Object { "name": "bar2", "references": Array [ Object { - "$ref": 13, + "$ref": 15, }, ], "scope": Object { - "$ref": 19, + "$ref": 21, }, }, ], @@ -35448,12 +36048,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 20, + "$ref": 22, }, "variables": Array [], } @@ -35517,6 +36125,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -35581,6 +36190,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -35645,6 +36255,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35690,6 +36301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -35705,14 +36317,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -35765,6 +36378,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35810,6 +36424,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -35825,14 +36440,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -35885,6 +36501,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35930,6 +36547,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -35945,14 +36563,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -36005,6 +36624,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36050,6 +36670,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36065,14 +36686,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -36125,6 +36747,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36170,6 +36793,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36185,254 +36809,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "TSTypeAliasDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "type-alias", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, - "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, - 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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "TSTypeAliasDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "type-alias", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", "upperScope": Object { "$ref": 3, }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -36452,7 +36837,7 @@ Object { "node": Object { "range": Array [ 0, - 17, + 15, ], "type": "TSTypeAliasDeclaration", }, @@ -36485,6 +36870,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36494,7 +36880,7 @@ Object { } `; -exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { "$id": 3, "block": Object { @@ -36530,6 +36916,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36545,14 +36932,138 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { "$ref": 3, }, - "variableMap": Object { + "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, + 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, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + 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": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -36605,6 +37116,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36614,7 +37126,7 @@ Object { } `; -exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { "$id": 3, "block": Object { @@ -36650,6 +37162,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36665,14 +37178,138 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { "$ref": 3, }, - "variableMap": Object { + "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, + 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, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + 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": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -36725,6 +37362,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36770,6 +37408,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36785,14 +37424,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -36845,6 +37485,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36890,6 +37531,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36905,14 +37547,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -36965,6 +37608,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37010,6 +37654,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -37025,14 +37670,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -37085,6 +37731,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37130,6 +37777,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -37145,14 +37793,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -37205,6 +37854,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37330,14 +37980,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -37404,14 +38055,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -37471,6 +38123,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37598,6 +38251,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -37626,14 +38280,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "UIElement": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -37699,6 +38354,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37744,6 +38400,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -37759,14 +38416,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -37819,6 +38477,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37854,6 +38513,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -37920,6 +38580,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37955,6 +38616,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38119,6 +38781,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38176,6 +38839,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38246,6 +38910,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38332,6 +38997,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -38455,6 +39121,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38490,6 +39157,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38556,6 +39224,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38601,6 +39270,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38661,6 +39331,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38721,6 +39392,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38766,6 +39438,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38826,6 +39499,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38886,6 +39560,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38931,6 +39606,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39034,6 +39710,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39094,6 +39771,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39139,6 +39817,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39154,6 +39833,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39214,6 +39894,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39259,6 +39940,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39274,14 +39956,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -39334,6 +40017,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39379,6 +40063,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39394,6 +40079,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39454,6 +40140,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39499,6 +40186,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39514,6 +40202,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39574,6 +40263,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39619,6 +40309,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39634,14 +40325,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -39694,6 +40386,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39729,6 +40422,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39795,6 +40489,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39850,6 +40545,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39903,6 +40599,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -39967,6 +40664,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -40031,6 +40729,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40086,6 +40785,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -40139,6 +40839,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -40203,6 +40904,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -40267,6 +40969,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40322,6 +41025,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -40375,6 +41079,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -40439,6 +41144,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -40503,6 +41209,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40578,6 +41285,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -40678,6 +41386,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -40742,6 +41451,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -40806,6 +41516,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40851,6 +41562,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -40933,6 +41645,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -40997,6 +41710,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41042,6 +41756,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -41124,6 +41839,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -41188,6 +41904,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41243,6 +41960,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -41296,6 +42014,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -41360,6 +42079,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -41424,6 +42144,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41479,6 +42200,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -41532,6 +42254,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -41596,6 +42319,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -41660,6 +42384,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41715,6 +42440,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -41768,6 +42494,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -41832,6 +42559,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -41896,6 +42624,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41951,6 +42680,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -42004,6 +42734,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -42068,6 +42799,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -42132,6 +42864,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42209,6 +42942,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -42287,6 +43021,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -42351,6 +43086,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -42415,6 +43151,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42551,6 +43288,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -42639,6 +43377,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -42709,6 +43448,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -42779,6 +43519,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42856,6 +43597,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -42934,6 +43676,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -42998,6 +43741,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -43062,6 +43806,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43139,6 +43884,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -43217,6 +43963,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -43281,6 +44028,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -43345,6 +44093,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43441,6 +44190,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -43523,6 +44273,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -43587,6 +44338,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -43651,6 +44403,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43747,6 +44500,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -43829,6 +44583,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -43893,6 +44648,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -43957,6 +44713,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44034,6 +44791,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -44112,6 +44870,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -44176,6 +44935,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -44240,6 +45000,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44317,6 +45078,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -44395,6 +45157,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -44459,6 +45222,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -44523,6 +45287,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44630,6 +45395,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -44700,6 +45466,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -44770,6 +45537,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44857,6 +45625,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -44924,6 +45693,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -44991,6 +45761,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45078,6 +45849,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -45145,6 +45917,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -45212,6 +45985,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45299,6 +46073,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -45366,6 +46141,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -45433,6 +46209,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45478,6 +46255,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -45538,6 +46316,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -45598,6 +46377,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45640,15 +46420,38 @@ 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": 4, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { @@ -45656,7 +46459,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -45700,31 +46503,14 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 29, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -45785,10 +46571,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45834,6 +46621,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -45916,6 +46704,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -45980,6 +46769,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46022,15 +46812,38 @@ 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": 4, }, "variableMap": Object { "a": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { @@ -46038,7 +46851,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -46082,31 +46895,14 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -46167,10 +46963,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46216,6 +47013,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46231,6 +47029,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46291,6 +47090,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46336,6 +47136,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46367,6 +47168,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -46427,6 +47229,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46472,6 +47275,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46487,14 +47291,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "M": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -46547,6 +47352,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46608,6 +47414,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46678,6 +47485,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46735,6 +47543,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46805,6 +47614,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46862,6 +47672,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46881,6 +47692,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46938,6 +47750,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46957,6 +47770,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47002,6 +47816,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47033,6 +47848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47093,6 +47909,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47138,6 +47955,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47169,6 +47987,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47229,6 +48048,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47284,6 +48104,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47315,6 +48136,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -47375,6 +48197,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -47435,6 +48258,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47480,6 +48304,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47537,6 +48362,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -47607,6 +48433,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47662,6 +48489,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47693,6 +48521,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -47753,6 +48582,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -47813,6 +48643,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47858,6 +48689,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -47873,14 +48705,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -47933,6 +48766,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47978,6 +48812,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -47993,6 +48828,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -48053,6 +48889,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48098,6 +48935,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48113,14 +48951,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -48173,6 +49012,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48218,6 +49058,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48233,14 +49074,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -48293,6 +49135,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48338,6 +49181,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48353,14 +49197,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "d": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -48413,6 +49258,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48458,6 +49304,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48473,14 +49320,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -48533,6 +49381,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48578,6 +49427,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48593,14 +49443,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -48653,6 +49504,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48698,6 +49550,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48713,14 +49566,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -48773,6 +49627,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48818,6 +49673,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48833,14 +49689,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -48893,6 +49750,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48938,6 +49796,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48953,14 +49812,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -49013,6 +49873,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49080,6 +49941,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49099,14 +49961,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -49163,6 +50026,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49230,6 +50094,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49249,14 +50114,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -49313,6 +50179,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49380,6 +50247,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49399,14 +50267,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -49463,6 +50332,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49530,6 +50400,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49549,14 +50420,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -49613,6 +50485,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49680,6 +50553,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49699,14 +50573,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -49763,6 +50638,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49830,6 +50706,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49849,14 +50726,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -49913,6 +50791,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50000,6 +50879,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -50022,14 +50902,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 4, }, @@ -50089,6 +50970,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50134,6 +51016,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50149,14 +51032,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -50209,6 +51093,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50254,6 +51139,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50269,14 +51155,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -50329,6 +51216,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50374,6 +51262,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50389,14 +51278,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -50449,6 +51339,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50494,6 +51385,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50509,14 +51401,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -50569,6 +51462,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50614,6 +51508,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50629,14 +51524,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -50689,6 +51585,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50734,6 +51631,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50749,14 +51647,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -50809,6 +51708,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50856,6 +51756,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50871,14 +51772,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -50931,6 +51833,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50994,6 +51897,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51013,6 +51917,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51076,6 +51981,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51095,6 +52001,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51130,6 +52037,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -51145,6 +52053,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51242,6 +52151,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -51267,6 +52177,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51369,6 +52280,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -51446,6 +52358,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51543,6 +52456,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -51568,6 +52482,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51645,6 +52560,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -51667,6 +52583,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51712,6 +52629,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51778,6 +52696,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -51793,6 +52712,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51870,6 +52790,7 @@ Object { }, ], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -51934,6 +52855,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -51998,6 +52920,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -52062,6 +52985,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52097,6 +53021,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -52121,6 +53046,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -52145,6 +53071,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -52160,6 +53087,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "global": Object { @@ -52321,6 +53249,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -52352,6 +53281,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -52425,6 +53355,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -52456,6 +53387,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -52559,6 +53491,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -52574,6 +53507,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52639,6 +53573,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -52756,6 +53691,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -52835,6 +53771,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -52850,14 +53787,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { + "typeMap": Object { "Id": Object { "$ref": 11, }, }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 15, }, @@ -52940,6 +53878,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 15, }, @@ -53043,6 +53982,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 16, }, @@ -53156,6 +54096,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53191,6 +54132,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -53206,6 +54148,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53251,6 +54194,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -53266,14 +54210,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -53326,6 +54271,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53361,6 +54307,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -53427,6 +54374,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53552,14 +54500,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -53626,14 +54575,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { + "typeMap": Object { "Element": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -53693,6 +54643,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53956,14 +54907,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 14, }, @@ -54051,14 +55003,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { + "typeMap": Object { "Unpacked": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 14, }, @@ -54133,6 +55086,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54259,14 +55213,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -54333,14 +55288,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 7, }, @@ -54403,6 +55359,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54438,6 +55395,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -54504,6 +55462,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54581,6 +55540,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -54654,6 +55614,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54749,13 +55710,15 @@ Object { }, ], "type": "module", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 1, - }, "f": Object { "$ref": 0, }, @@ -54869,6 +55832,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54926,6 +55890,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -54996,6 +55961,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55053,6 +56019,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55123,6 +56090,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55200,6 +56168,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -55273,6 +56242,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55368,13 +56338,15 @@ Object { }, ], "type": "module", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 1, - }, "f": Object { "$ref": 0, }, @@ -55488,6 +56460,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55545,6 +56518,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55615,6 +56589,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55682,6 +56657,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55701,14 +56677,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -55765,6 +56742,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55832,6 +56810,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55851,14 +56830,15 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -55915,6 +56895,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55972,6 +56953,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56042,6 +57024,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56099,6 +57082,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56169,6 +57153,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56214,6 +57199,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -56229,14 +57215,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -56289,6 +57276,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56334,6 +57322,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -56349,14 +57338,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -56409,6 +57399,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56454,6 +57445,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -56469,14 +57461,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -56529,6 +57522,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56606,6 +57600,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -56679,6 +57674,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56786,14 +57782,15 @@ Object { }, ], "type": "type-alias", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -56853,14 +57850,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "LinkedList": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -56917,6 +57915,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56952,6 +57951,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -57018,6 +58018,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57053,6 +58054,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -57119,6 +58121,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57154,6 +58157,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -57220,6 +58224,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57277,6 +58282,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57347,6 +58353,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57404,6 +58411,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57474,6 +58482,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57531,6 +58540,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57601,6 +58611,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57658,6 +58669,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57728,6 +58740,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57785,6 +58798,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57855,6 +58869,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57900,6 +58915,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -57915,14 +58931,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -57975,6 +58992,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58020,6 +59038,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -58035,14 +59054,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -58095,6 +59115,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58152,6 +59173,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -58222,6 +59244,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58279,6 +59302,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -58349,6 +59373,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58426,6 +59451,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -58499,6 +59525,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58554,6 +59581,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -58585,6 +59613,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58645,6 +59674,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -58705,6 +59735,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58760,6 +59791,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -58824,6 +59856,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -58874,6 +59907,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -58934,6 +59968,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -59040,6 +60075,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 19, }, @@ -59123,6 +60159,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -59243,6 +60280,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -59307,6 +60345,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -59338,6 +60377,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 27, }, @@ -59411,6 +60451,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 28, }, @@ -59471,6 +60512,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59506,6 +60548,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -59572,6 +60615,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59607,6 +60651,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -59673,6 +60718,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59708,6 +60754,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -59774,6 +60821,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59809,6 +60857,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -59875,6 +60924,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59920,6 +60970,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -59935,14 +60986,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -59995,6 +61047,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60030,6 +61083,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -60096,6 +61150,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60153,6 +61208,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -60272,6 +61328,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60329,6 +61386,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60399,6 +61457,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60434,6 +61493,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -60647,6 +61707,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60692,6 +61753,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -60707,14 +61769,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -60767,6 +61830,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts index 3def6a382deb..9b629c200fff 100644 --- a/packages/parser/tests/tools/scope-analysis.ts +++ b/packages/parser/tests/tools/scope-analysis.ts @@ -134,6 +134,12 @@ export function scopeToJSON( map[name] = resolver.ref(variable); return map; }, {}); + const typeMap = Array.from(scope.setTypes.entries()).reduce< + Record + >((map, [name, variable]) => { + map[name] = resolver.ref(variable); + return map; + }, {}); const throughReferences = scope.through.map(resolver.ref, resolver); const variableScope = resolver.ref(scope.variableScope); const upperScope = resolver.ref(scope.upper); @@ -147,6 +153,7 @@ export function scopeToJSON( variables, references, variableMap, + typeMap, throughReferences, variableScope, upperScope, From 67090daa81fce49b281939dc359e00f2c36f23c2 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 23:52:22 +0100 Subject: [PATCH 09/12] fix(parser): fix scopes --- .../tests/rules/no-unused-vars.test.ts | 9 +- packages/parser/src/scope/scopes.ts | 255 ++++++++---------- .../lib/__snapshots__/scope-analysis.ts.snap | 139 +++++----- .../lib/__snapshots__/typescript.ts.snap | 178 +++++++----- 4 files changed, 298 insertions(+), 283 deletions(-) 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 5113ba3fdb38..54e0aa43deb1 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -990,8 +990,8 @@ new test(); errors: error([ { message: "'foo' is defined but never used.", - line: 3, - column: 10, + line: 2, + column: 7, }, ]), }, @@ -1017,6 +1017,11 @@ class bar {}; line: 4, column: 7, }, + { + message: "'test' is defined but never used.", + line: 4, + column: 11, + }, ]), }, { diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index 9e7c6b403d6d..7e4519aa6f38 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -5,46 +5,90 @@ import { } from '@typescript-eslint/experimental-utils'; import { ScopeManager } from './scope-manager'; -export class Scope extends TSESLintScope.Scope { - setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; +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); + } +} - /** @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); - } +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; - __resolveType(ref: TSESLintScope.Reference): boolean { - const name = ref.identifier.name; + return true; +} - if (!this.setTypes.has(name)) { - return false; - } - const variable = this.setTypes.get(name); +function resolveTypeLike(this: Scope, ref: TSESLintScope.Reference): boolean { + const name = ref.identifier.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; + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + if (!this.__isValidResolution(ref, variable)) { + return false; + } - return true; + 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 */ + __resolveType = resolveType; + + /** @internal */ + __resolveTypeLike = resolveTypeLike; + /** @internal */ __resolve(ref: TSESLintScope.Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); } - return super.__resolve(ref); + return super.__resolve.call(this, ref); } } @@ -94,37 +138,19 @@ export class TypeAliasScope extends Scope { export class GlobalScope extends TSESLintScope.GlobalScope implements Scope { setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - - __resolveType(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; + /** @internal */ + __resolveType = resolveType; - return true; - } + /** @internal */ + __resolveTypeLike = resolveTypeLike; /** @internal */ __resolve(ref: TSESLintScope.Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); } - return super.__resolve(ref); + return TSESLintScope.Scope.prototype.__resolve.call(this, ref); } /** @internal */ @@ -161,130 +187,65 @@ export class FunctionExpressionNameScope extends TSESLintScope.FunctionExpressionNameScope implements Scope { setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - - __resolveType(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; + /** @internal */ + __defineType = defineType; - return true; - } + /** @internal */ + __resolveType = resolveType; /** @internal */ - __resolve(ref: TSESLintScope.Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; - } - return super.__resolve(ref); - } + __resolveTypeLike = resolveTypeLike; /** @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); + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); } + return super.__resolve.call(this, ref); } } export class WithScope extends TSESLintScope.WithScope implements Scope { setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - - __resolveType(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; + /** @internal */ + __defineType = defineType; - return true; - } + /** @internal */ + __resolveType = resolveType; /** @internal */ - __resolve(ref: TSESLintScope.Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; - } - return super.__resolve(ref); - } + __resolveTypeLike = resolveTypeLike; /** @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); + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); } + return super.__resolve.call(this, ref); } } export class FunctionScope extends TSESLintScope.FunctionScope implements Scope { setTypes: Map = new Map(); - types: TSESLintScope.Variable[] = []; - __resolveType(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; + /** @internal */ + __defineType = defineType; - return true; - } + /** @internal */ + __resolveType = resolveType; /** @internal */ - __resolve(ref: TSESLintScope.Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; - } - return super.__resolve(ref); - } + __resolveTypeLike = resolveTypeLike; /** @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); + __resolve(ref: TSESLintScope.Reference): boolean { + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return super.__resolve.call(this, ref); } } } diff --git a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap index 570c4dab0034..68bfdcef8af2 100644 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap @@ -1855,9 +1855,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -1874,9 +1872,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -1893,9 +1889,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -1912,9 +1906,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], @@ -2039,6 +2031,18 @@ Object { Object { "$ref": 6, }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, ], "type": "module", "typeMap": Object { @@ -2106,12 +2110,6 @@ Object { Object { "$ref": 3, }, - Object { - "$ref": 7, - }, - Object { - "$ref": 9, - }, ], "scope": Object { "$ref": 12, @@ -2162,12 +2160,6 @@ Object { Object { "$ref": 5, }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, ], "scope": Object { "$ref": 12, @@ -2226,6 +2218,18 @@ Object { Object { "$ref": 6, }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, ], "type": "global", "typeMap": Object {}, @@ -2286,9 +2290,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -2305,9 +2307,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -2324,9 +2324,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -2343,9 +2341,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], @@ -2470,6 +2466,18 @@ Object { Object { "$ref": 6, }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, ], "type": "module", "typeMap": Object { @@ -2537,12 +2545,6 @@ Object { Object { "$ref": 3, }, - Object { - "$ref": 7, - }, - Object { - "$ref": 9, - }, ], "scope": Object { "$ref": 12, @@ -2593,12 +2595,6 @@ Object { Object { "$ref": 5, }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, ], "scope": Object { "$ref": 12, @@ -2657,6 +2653,18 @@ Object { Object { "$ref": 6, }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, ], "type": "global", "typeMap": Object {}, @@ -8322,9 +8330,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -8415,7 +8421,11 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 9, + }, + ], "type": "module", "typeMap": Object { "A": Object { @@ -8619,11 +8629,7 @@ Object { }, ], "name": "a", - "references": Array [ - Object { - "$ref": 9, - }, - ], + "references": Array [], "scope": Object { "$ref": 13, }, @@ -8634,7 +8640,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 9, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, @@ -9825,9 +9835,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -9849,6 +9857,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -9912,9 +9923,6 @@ Object { Object { "$ref": 1, }, - Object { - "$ref": 2, - }, ], "scope": Object { "$ref": 4, @@ -9927,6 +9935,9 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 2, + }, Object { "$ref": 3, }, diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index c6d0af35226d..3ecef1516eff 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -9864,9 +9864,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -10023,6 +10021,9 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "module", "typeMap": Object {}, @@ -10073,11 +10074,7 @@ Object { }, ], "name": "M", - "references": Array [ - Object { - "$ref": 5, - }, - ], + "references": Array [], "scope": Object { "$ref": 8, }, @@ -10092,6 +10089,9 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "global", "typeMap": Object {}, @@ -32304,13 +32304,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "typeMap": Object {}, "upperScope": Object { @@ -32360,11 +32362,7 @@ Object { }, ], "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "references": Array [], "scope": Object { "$ref": 4, }, @@ -32401,7 +32399,11 @@ Object { }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "typeMap": Object {}, "upperScope": Object { @@ -32472,7 +32474,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, @@ -32532,13 +32538,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "typeMap": Object {}, "upperScope": Object { @@ -32602,11 +32610,7 @@ Object { }, ], "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "references": Array [], "scope": Object { "$ref": 4, }, @@ -32617,7 +32621,11 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "typeMap": Object {}, "upperScope": Object { @@ -32678,7 +32686,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, @@ -33152,13 +33164,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "typeMap": Object {}, "upperScope": Object { @@ -33208,11 +33222,7 @@ Object { }, ], "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "references": Array [], "scope": Object { "$ref": 4, }, @@ -33249,7 +33259,11 @@ Object { }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "typeMap": Object {}, "upperScope": Object { @@ -33320,7 +33334,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, @@ -33380,13 +33398,15 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "typeMap": Object {}, "upperScope": Object { @@ -33450,11 +33470,7 @@ Object { }, ], "name": "x", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "references": Array [], "scope": Object { "$ref": 4, }, @@ -33465,7 +33481,11 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "typeMap": Object {}, "upperScope": Object { @@ -33526,7 +33546,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, @@ -34000,9 +34024,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -34025,7 +34047,11 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "typeMap": Object {}, "upperScope": Object { @@ -34076,9 +34102,6 @@ Object { ], "name": "x", "references": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -34119,7 +34142,11 @@ Object { }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "typeMap": Object {}, "upperScope": Object { @@ -34190,7 +34217,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, @@ -34250,9 +34281,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -34275,7 +34304,11 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "typeMap": Object {}, "upperScope": Object { @@ -34340,9 +34373,6 @@ Object { ], "name": "x", "references": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -34357,7 +34387,11 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "typeMap": Object {}, "upperScope": Object { @@ -34418,7 +34452,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, From b19fd8129d0dc235a6c3d3f7b80bd603c45c20ba Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 14 Feb 2019 02:01:22 +0100 Subject: [PATCH 10/12] fix(parser): correct typeParameters in interfaces --- .../tests/eslint-rules/no-redeclare.test.ts | 4 + packages/parser/src/analyze-scope.ts | 4 +- .../lib/__snapshots__/scope-analysis.ts.snap | 492 ++++++++------- .../lib/__snapshots__/typescript.ts.snap | 597 +++++++++--------- 4 files changed, 583 insertions(+), 514 deletions(-) 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/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 0a92433bbf79..f07eed3e1b89 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -415,8 +415,6 @@ class Referencer extends TSESLintScope.Referencer { const scopeManager = this.scopeManager; const scope = this.currentScope(); - this.visit(node.typeParameters); - if (node.id) { scope.__defineType( node.id, @@ -426,6 +424,8 @@ class Referencer extends TSESLintScope.Referencer { scopeManager.__nestInterfaceScope(node); + this.visit(node.typeParameters); + if (node.extends) { node.extends.forEach(this.visit, this); } diff --git a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap index 68bfdcef8af2..9a8253c9e83e 100644 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap @@ -8807,7 +8807,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/interface-type.ts 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -8817,7 +8817,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -8827,7 +8827,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -8841,18 +8841,63 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, - "variables": Array [], + "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": 6, + "$id": 7, "block": Object { "range": Array [ 27, @@ -8867,7 +8912,26 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 6, + "$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", @@ -8879,7 +8943,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 0, }, "writeExpr": undefined, }, @@ -8888,132 +8952,90 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 4, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, - "variables": Array [], + "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 [ - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 49, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "typeMap": Object { "C": Object { - "$ref": 1, + "$ref": 0, }, "R": Object { - "$ref": 2, - }, - "T": Object { - "$ref": 0, + "$ref": 1, }, }, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { "$id": 0, - "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", - }, - 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 [ - 12, - 13, - ], - "type": "Identifier", - }, - Object { - "name": "T", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - ], - "name": "T", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -9049,18 +9071,18 @@ Object { "name": "C", "references": Array [ Object { - "$ref": 3, + "$ref": 5, }, Object { - "$ref": 5, + "$ref": 6, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -9096,7 +9118,7 @@ Object { "name": "R", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -9111,7 +9133,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], } @@ -25402,7 +25424,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/interface-type.ts 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -25412,7 +25434,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25426,18 +25448,63 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, - "variables": Array [], + "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": 6, + "$id": 7, "block": Object { "range": Array [ 27, @@ -25452,7 +25519,24 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 6, + "$ref": 7, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, }, "identifier": Object { "name": "C", @@ -25471,135 +25555,95 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 4, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, - "variables": Array [], + "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": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 49, - 50, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 5, }, Object { - "$ref": 5, + "$ref": 6, }, ], "type": "global", "typeMap": Object { "C": Object { - "$ref": 1, + "$ref": 0, }, "R": Object { - "$ref": 2, - }, - "T": Object { - "$ref": 0, + "$ref": 1, }, }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { "$id": 0, - "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", - }, - 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 [ - 12, - 13, - ], - "type": "Identifier", - }, - Object { - "name": "T", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - ], - "name": "T", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -25635,11 +25679,11 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -25675,7 +25719,7 @@ Object { "name": "R", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index 3ecef1516eff..240bd76795c9 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -23548,7 +23548,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 3, }, @@ -23556,7 +23560,48 @@ Object { "variableScope": Object { "$ref": 3, }, - "variables": Array [], + "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, @@ -23566,9 +23611,6 @@ Object { "type": "module", "typeMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -23582,46 +23624,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 3, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -24719,7 +24721,11 @@ Object { }, ], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 5, }, @@ -24727,7 +24733,48 @@ Object { "variableScope": Object { "$ref": 5, }, - "variables": Array [], + "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, @@ -24744,9 +24791,6 @@ Object { "type": "module", "typeMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -24760,46 +24804,6 @@ Object { "variables": Array [ Object { "$id": 0, - "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": 5, - }, - }, - Object { - "$id": 1, "defs": Array [ Object { "name": Object { @@ -24899,7 +24903,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 3, }, @@ -24907,7 +24915,48 @@ Object { "variableScope": Object { "$ref": 3, }, - "variables": Array [], + "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, @@ -24916,63 +24965,20 @@ Object { "throughReferences": Array [], "type": "module", "typeMap": Object { - "T": Object { - "$ref": 0, - }, "Test": Object { - "$ref": 1, + "$ref": 0, }, }, "upperScope": Object { "$ref": 4, }, "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "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": 3, - }, - }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { @@ -35327,7 +35333,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 22, + "$id": 23, "block": Object { "range": Array [ 0, @@ -35337,7 +35343,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 21, + "$id": 22, "block": Object { "range": Array [ 0, @@ -35347,7 +35353,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 9, "block": Object { "range": Array [ 0, @@ -35360,9 +35366,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -35374,7 +35380,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 8, + "$ref": 7, }, "writeExpr": undefined, }, @@ -35383,23 +35389,23 @@ Object { "type": "class", "typeMap": Object { "A": Object { - "$ref": 8, + "$ref": 7, }, }, "upperScope": Object { - "$ref": 21, + "$ref": 22, }, "variableMap": Object { "foo": Object { - "$ref": 7, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 21, + "$ref": 22, }, "variables": Array [ Object { - "$id": 7, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -35435,11 +35441,11 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, Object { - "$id": 8, + "$id": 7, "defs": Array [ Object { "name": Object { @@ -35475,17 +35481,17 @@ Object { "name": "A", "references": Array [ Object { - "$ref": 9, + "$ref": 8, }, ], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, ], }, Object { - "$id": 14, + "$id": 13, "block": Object { "range": Array [ 75, @@ -35498,9 +35504,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 13, + "$id": 12, "from": Object { - "$ref": 14, + "$ref": 13, }, "identifier": Object { "name": "A", @@ -35512,7 +35518,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 12, + "$ref": 11, }, "writeExpr": undefined, }, @@ -35521,23 +35527,23 @@ Object { "type": "class", "typeMap": Object { "A": Object { - "$ref": 12, + "$ref": 11, }, }, "upperScope": Object { - "$ref": 21, + "$ref": 22, }, "variableMap": Object { "foo2": Object { - "$ref": 11, + "$ref": 10, }, }, "variableScope": Object { - "$ref": 21, + "$ref": 22, }, "variables": Array [ Object { - "$id": 11, + "$id": 10, "defs": Array [ Object { "name": Object { @@ -35573,11 +35579,11 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, Object { - "$id": 12, + "$id": 11, "defs": Array [ Object { "name": Object { @@ -35613,11 +35619,11 @@ Object { "name": "A", "references": Array [ Object { - "$ref": 13, + "$ref": 12, }, ], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, ], @@ -35650,7 +35656,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 4, + "$ref": 3, }, "writeExpr": undefined, }, @@ -35669,7 +35675,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 14, }, "writeExpr": undefined, }, @@ -35678,23 +35684,69 @@ Object { Object { "$ref": 15, }, - Object { - "$ref": 16, - }, ], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "A": Object { + "$ref": 14, + }, + }, "upperScope": Object { - "$ref": 21, + "$ref": 22, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 21, + "$ref": 22, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 14, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 191, + 192, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 179, + 203, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 191, + 192, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 16, + }, + ], + "scope": Object { + "$ref": 17, + }, + }, + ], }, Object { - "$id": 20, + "$id": 21, "block": Object { "range": Array [ 245, @@ -35707,9 +35759,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 18, + "$id": 19, "from": Object { - "$ref": 20, + "$ref": 21, }, "identifier": Object { "name": "bar", @@ -35721,14 +35773,14 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 2, }, "writeExpr": undefined, }, Object { - "$id": 19, + "$id": 20, "from": Object { - "$ref": 20, + "$ref": 21, }, "identifier": Object { "name": "A", @@ -35740,38 +35792,84 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 18, }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 18, - }, Object { "$ref": 19, }, ], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "A": Object { + "$ref": 18, + }, + }, "upperScope": Object { - "$ref": 21, + "$ref": 22, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 21, + "$ref": 22, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 18, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 272, + 273, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 260, + 298, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 272, + 273, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 20, + }, + ], + "scope": Object { + "$ref": 21, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 21, + "$ref": 22, }, "identifier": Object { "name": "bar", @@ -35786,9 +35884,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 21, + "$ref": 22, }, "identifier": Object { "name": "bar", @@ -35805,26 +35903,23 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 4, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "module", "typeMap": Object { - "A": Object { - "$ref": 2, - }, "bar": Object { - "$ref": 3, + "$ref": 2, }, "bar2": Object { - "$ref": 4, + "$ref": 3, }, }, "upperScope": Object { - "$ref": 22, + "$ref": 23, }, "variableMap": Object { "foo": Object { @@ -35835,7 +35930,7 @@ Object { }, }, "variableScope": Object { - "$ref": 21, + "$ref": 22, }, "variables": Array [ Object { @@ -35875,7 +35970,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 22, }, }, Object { @@ -35915,85 +36010,11 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 22, }, }, Object { "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 191, - 192, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 179, - 203, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - Object { - "name": Object { - "name": "A", - "range": Array [ - 272, - 273, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 260, - 298, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 191, - 192, - ], - "type": "Identifier", - }, - Object { - "name": "A", - "range": Array [ - 272, - 273, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [ - Object { - "$ref": 16, - }, - Object { - "$ref": 19, - }, - ], - "scope": Object { - "$ref": 21, - }, - }, - Object { - "$id": 3, "defs": Array [ Object { "name": Object { @@ -36029,15 +36050,15 @@ Object { "name": "bar", "references": Array [ Object { - "$ref": 18, + "$ref": 19, }, ], "scope": Object { - "$ref": 21, + "$ref": 22, }, }, Object { - "$id": 4, + "$id": 3, "defs": Array [ Object { "name": Object { @@ -36077,7 +36098,7 @@ Object { }, ], "scope": Object { - "$ref": 21, + "$ref": 22, }, }, ], @@ -36088,10 +36109,10 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 4, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "global", @@ -36099,7 +36120,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 22, + "$ref": 23, }, "variables": Array [], } From d4916ba8e48b761ee8ba50dfc4bc75cd617695ce Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 2 Mar 2019 19:38:14 +0100 Subject: [PATCH 11/12] fix(parser): correct compile errors in tests --- .../tests/rules/no-unused-vars.test.ts | 6 ++-- .../tests/rules/no-use-before-define.test.ts | 25 +++++++++++++- packages/parser/src/analyze-scope.ts | 25 ++++++-------- packages/parser/tests/tools/scope-analysis.ts | 34 +++++++++++-------- 4 files changed, 58 insertions(+), 32 deletions(-) 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 54e0aa43deb1..24a0fae1a568 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -489,7 +489,7 @@ 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(); } } `, @@ -989,7 +989,7 @@ new test(); `, errors: error([ { - message: "'foo' is defined but never used.", + message: "'foo' is assigned a value but never used.", line: 2, column: 7, }, @@ -1008,7 +1008,7 @@ class bar {}; column: 6, }, { - message: "'test' is defined but never used.", + message: "'test' is assigned a value but never used.", line: 3, column: 7, }, 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 c13baec5b041..1948266fa8e1 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' }, }, ], }, @@ -963,7 +987,6 @@ type Foo = string | number data: { name: 'Foo', }, - type: AST_NODE_TYPES.Identifier, }, ], }, diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index f07eed3e1b89..6976ca2c932a 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -652,7 +652,17 @@ class Referencer extends TSESLintScope.Referencer { * @param node The TSPropertySignature node to visit. */ TSPropertySignature(node: TSESTree.TSPropertySignature): void { - this.visitTypeProperty(node); + const upperTypeMode = this.typeMode; + this.typeMode = true; + + if (node.computed) { + this.visit(node.key); + } + + this.visit(node.typeAnnotation); + this.visit(node.initializer); + + this.typeMode = upperTypeMode; } /** @@ -915,19 +925,6 @@ class Referencer extends TSESLintScope.Referencer { this.typeMode = upperTypeMode; } - visitTypeProperty(node: TSESTree.TSPropertySignature): void { - const upperTypeMode = this.typeMode; - - if (node.computed) { - this.visit(node.key); - } - - this.visit(node.typeAnnotation); - this.visit(node.initializer); - - this.typeMode = upperTypeMode; - } - /** * @param node */ diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts index 9b629c200fff..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,29 +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 typeMap = Array.from(scope.setTypes.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, From f115957974fdb2931dce80e27cc8eed1b99d50b9 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 22 Jan 2020 02:26:13 +0100 Subject: [PATCH 12/12] fix: code cleanup --- .../src/rules/no-use-before-define.ts | 18 ++++ .../tests/rules/no-use-before-define.test.ts | 10 +-- packages/parser/src/analyze-scope.ts | 6 +- packages/parser/src/scope/scopes.ts | 82 ++++++++++++------- 4 files changed, 78 insertions(+), 38 deletions(-) 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/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts index 1948266fa8e1..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 @@ -910,19 +910,19 @@ enum Foo { line: 3, column: 13, messageId: 'noUseBeforeDefine', - data: { name: 'foo' }, + data: { name: 'Foo' }, }, { line: 3, column: 19, messageId: 'noUseBeforeDefine', - data: { name: 'foo' }, + data: { name: 'Foo' }, }, { line: 4, column: 12, messageId: 'noUseBeforeDefine', - data: { name: 'foo' }, + data: { name: 'Foo' }, }, ], }, @@ -946,13 +946,13 @@ enum Foo { line: 2, column: 17, messageId: 'noUseBeforeDefine', - data: { name: 'foo' }, + data: { name: 'Foo' }, }, { line: 3, column: 10, messageId: 'noUseBeforeDefine', - data: { name: 'foo' }, + data: { name: 'Foo' }, }, ], }, diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 6976ca2c932a..d09f6d51510a 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -781,9 +781,11 @@ class Referencer extends TSESLintScope.Referencer { } TSTypeAliasDeclaration(node: TSESTree.TSTypeAliasDeclaration): void { + const upperTypeMode = this.typeMode; + this.typeMode = true; + const scopeManager = this.scopeManager; const scope = this.currentScope(); - this.typeMode = true; if (node.id && node.id.type === AST_NODE_TYPES.Identifier) { scope.__defineType( @@ -811,7 +813,7 @@ class Referencer extends TSESLintScope.Referencer { this.close(node); - this.typeMode = false; + this.typeMode = upperTypeMode; } /** diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index 7e4519aa6f38..f21b8e55dbb7 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -78,17 +78,21 @@ export class Scope extends TSESLintScope.Scope { __defineType = defineType; /** @internal */ - __resolveType = resolveType; + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } - /** @internal */ - __resolveTypeLike = resolveTypeLike; + return super.__shouldStaticallyCloseForGlobal(ref); + } /** @internal */ __resolve(ref: TSESLintScope.Reference): boolean { if (ref.typeMode) { - return this.__resolveType(ref) || this.__resolveTypeLike(ref); + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); } - return super.__resolve.call(this, ref); + return super.__resolve(ref); } } @@ -140,17 +144,21 @@ export class GlobalScope extends TSESLintScope.GlobalScope implements Scope { setTypes: Map = new Map(); /** @internal */ - __resolveType = resolveType; + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } - /** @internal */ - __resolveTypeLike = resolveTypeLike; + return super.__shouldStaticallyCloseForGlobal(ref); + } /** @internal */ __resolve(ref: TSESLintScope.Reference): boolean { if (ref.typeMode) { - return this.__resolveType(ref) || this.__resolveTypeLike(ref); + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); } - return TSESLintScope.Scope.prototype.__resolve.call(this, ref); + return super.__resolve(ref); } /** @internal */ @@ -192,17 +200,21 @@ export class FunctionExpressionNameScope __defineType = defineType; /** @internal */ - __resolveType = resolveType; + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } - /** @internal */ - __resolveTypeLike = resolveTypeLike; + return super.__shouldStaticallyCloseForGlobal(ref); + } /** @internal */ __resolve(ref: TSESLintScope.Reference): boolean { if (ref.typeMode) { - return this.__resolveType(ref) || this.__resolveTypeLike(ref); + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); } - return super.__resolve.call(this, ref); + return super.__resolve(ref); } } @@ -213,17 +225,21 @@ export class WithScope extends TSESLintScope.WithScope implements Scope { __defineType = defineType; /** @internal */ - __resolveType = resolveType; + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } - /** @internal */ - __resolveTypeLike = resolveTypeLike; + return super.__shouldStaticallyCloseForGlobal(ref); + } /** @internal */ __resolve(ref: TSESLintScope.Reference): boolean { if (ref.typeMode) { - return this.__resolveType(ref) || this.__resolveTypeLike(ref); + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); } - return super.__resolve.call(this, ref); + return super.__resolve(ref); } } @@ -235,24 +251,28 @@ export class FunctionScope extends TSESLintScope.FunctionScope __defineType = defineType; /** @internal */ - __resolveType = resolveType; + __shouldStaticallyCloseForGlobal(this: Scope, ref: TSESLintScope.Reference) { + const name = ref.identifier.name; + if (this.setTypes.has(name)) { + return false; + } - /** @internal */ - __resolveTypeLike = resolveTypeLike; + return super.__shouldStaticallyCloseForGlobal(ref); + } /** @internal */ __resolve(ref: TSESLintScope.Reference): boolean { if (ref.typeMode) { - return this.__resolveType(ref) || this.__resolveTypeLike(ref); + return resolveType.call(this, ref) || resolveTypeLike.call(this, ref); } else { - return super.__resolve.call(this, ref); + return super.__resolve(ref); } } } // eslint simple scopes -export class ModuleScope extends Scope { +export class ModuleScope extends Scope implements TSESLintScope.ModuleScope { constructor( scopeManager: ScopeManager, upperScope: Scope, @@ -262,7 +282,7 @@ export class ModuleScope extends Scope { } } -export class CatchScope extends Scope { +export class CatchScope extends Scope implements TSESLintScope.CatchScope { constructor( scopeManager: ScopeManager, upperScope: Scope, @@ -272,7 +292,7 @@ export class CatchScope extends Scope { } } -export class BlockScope extends Scope { +export class BlockScope extends Scope implements TSESLintScope.BlockScope { constructor( scopeManager: ScopeManager, upperScope: Scope, @@ -282,7 +302,7 @@ export class BlockScope extends Scope { } } -export class SwitchScope extends Scope { +export class SwitchScope extends Scope implements TSESLintScope.SwitchScope { constructor( scopeManager: ScopeManager, upperScope: Scope, @@ -292,7 +312,7 @@ export class SwitchScope extends Scope { } } -export class ForScope extends Scope { +export class ForScope extends Scope implements TSESLintScope.ForScope { constructor( scopeManager: ScopeManager, upperScope: Scope, @@ -302,7 +322,7 @@ export class ForScope extends Scope { } } -export class ClassScope extends Scope { +export class ClassScope extends Scope implements TSESLintScope.ClassScope { constructor( scopeManager: ScopeManager, upperScope: Scope,