From 1fc7917c6e30c17d387b8f52923de2cd4c34aec6 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 | 18 +- packages/parser/src/analyze-scope.ts | 239 +- packages/parser/src/parser.ts | 3 +- packages/parser/src/scope/definition.ts | 28 + packages/parser/src/scope/reference.ts | 39 + packages/parser/src/scope/scope-manager.ts | 23 +- packages/parser/src/scope/scopes.ts | 53 +- .../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 | 30842 +++++++++---- packages/parser/typings/eslint-scope.d.ts | 59 +- 19 files changed, 45515 insertions(+), 22432 deletions(-) create mode 100644 packages/parser/src/scope/definition.ts create mode 100644 packages/parser/src/scope/reference.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 544ba92938e8..17d47104eadf 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -24,41 +24,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) { 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 a9ca37ca4ea4..6a30eb332e75 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -126,23 +126,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'; @@ -264,14 +272,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; } `, @@ -307,7 +315,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; } `, @@ -315,52 +323,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 @@ -381,7 +401,7 @@ new A(); ` import { Nullable } from 'nullable'; import { SomeOther } from 'other'; -function foo() { +function foo(): T { } foo(); `, @@ -468,47 +488,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, } `, @@ -614,7 +638,7 @@ export default class Foo { code: ` import { ClassDecoratorFactory } from 'decorators'; export class Foo {} - `, + `, errors: error([ { message: "'ClassDecoratorFactory' is defined but never used.", @@ -628,12 +652,17 @@ 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 } ]) }, @@ -642,7 +671,7 @@ baz() import { Nullable } from 'nullable'; const a: string = 'hello'; console.log(a); - `, + `, errors: error([ { message: "'Nullable' is defined but never used.", @@ -731,6 +760,11 @@ interface A { message: "'Another' is defined but never used.", line: 3, column: 10 + }, + { + message: "'A' is defined but never used.", + line: 4, + column: 11 } ]) }, @@ -747,6 +781,11 @@ interface A { message: "'Another' is defined but never used.", line: 3, column: 10 + }, + { + message: "'A' is defined but never used.", + line: 4, + column: 11 } ]) }, @@ -884,6 +923,127 @@ export class Bar implements baz().test {} column: 8 } ]) + }, + { + 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 26cb25efbaf7..f7d48514fcf8 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 @@ -171,7 +171,7 @@ var bar; { code: ` var x: Foo = 2; -type Foo = string | number +type Foo = string | number; `, options: [{ typedefs: false }] }, @@ -840,6 +840,22 @@ var bar; type: AST_NODE_TYPES.Identifier } ] + }, + // 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/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 60f9bcd8f90a..a1ca9adc8034 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -1,5 +1,3 @@ -import { ScopeManager } from './scope/scope-manager'; -import { Definition, ParameterDefinition } from 'eslint-scope/lib/definition'; import OriginalPatternVisitor from 'eslint-scope/lib/pattern-visitor'; import Reference from 'eslint-scope/lib/reference'; import OriginalReferencer from 'eslint-scope/lib/referencer'; @@ -12,6 +10,14 @@ import { } from 'eslint-scope/lib/options'; import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; +import { + Definition, + ParameterDefinition, + TypeDefinition +} from './scope/definition'; +import { typeReferencing } from './scope/reference'; +import { ScopeManager } from './scope/scope-manager'; + /** * Define the override function of `Scope#__define` for global augmentation. * @param {Function} define The original Scope#__define method. @@ -38,6 +44,16 @@ class PatternVisitor extends OriginalPatternVisitor { super(options, rootPattern, callback); } + static isPattern(node: TSESTree.Node) { + const nodeType = node.type; + + return ( + OriginalPatternVisitor.isPattern(node) || + nodeType === AST_NODE_TYPES.TSParameterProperty || + nodeType === AST_NODE_TYPES.TSTypeParameter + ); + } + Identifier(node: TSESTree.Identifier): void { super.Identifier(node); if (node.decorators) { @@ -80,10 +96,22 @@ class PatternVisitor extends OriginalPatternVisitor { 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 OriginalReferencer { @@ -102,8 +130,8 @@ class Referencer extends OriginalReferencer { */ visitPattern( node: T, - options: PatternVisitorOptions, - callback: PatternVisitorCallback + options: PatternVisitorOptions | PatternVisitorCallback, + callback?: PatternVisitorCallback ): void { if (!node) { return; @@ -114,11 +142,11 @@ class Referencer extends OriginalReferencer { options = { processRightHandNodes: false }; } - const visitor = new PatternVisitor(this.options, node, callback); + const visitor = new PatternVisitor(this.options, node, callback!); visitor.visit(node); + // Process the right hand nodes recursively. if (options.processRightHandNodes) { - // @ts-ignore visitor.rightHandNodes.forEach(this.visit, this); } } @@ -151,7 +179,6 @@ class Referencer extends OriginalReferencer { const def = defs[i]; if ( def.type === 'FunctionName' && - // @ts-ignore def.node.type === 'TSDeclareFunction' ) { defs.splice(i, 1); @@ -214,6 +241,9 @@ class Referencer extends OriginalReferencer { const upperTypeMode = this.typeMode; this.typeMode = true; + if (node.typeParameters) { + this.visit(node.typeParameters); + } if (node.superTypeParameters) { this.visit(node.superTypeParameters); } @@ -257,9 +287,13 @@ class Referencer extends OriginalReferencer { * @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); } @@ -406,7 +440,31 @@ class Referencer extends OriginalReferencer { * @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; } /** @@ -472,7 +530,23 @@ class Referencer extends OriginalReferencer { * @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); + } + ); + } } /** @@ -593,21 +667,7 @@ class Referencer extends OriginalReferencer { * @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); } /** @@ -615,22 +675,25 @@ class Referencer extends OriginalReferencer { * @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) { + this.visitTypeFunctionSignature(node); } /** @@ -706,8 +769,29 @@ class Referencer extends OriginalReferencer { } 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 === 'Identifier') { + scope.__define( + node.id, + new 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; } @@ -724,6 +808,7 @@ class Referencer extends OriginalReferencer { TSAbstractClassProperty(node: TSESTree.TSAbstractClassProperty): void { this.ClassProperty(node); } + TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void { this.MethodDefinition(node); } @@ -790,9 +875,83 @@ class Referencer extends OriginalReferencer { 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) { + 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 + ) { + 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(ast: any, parserOptions: ParserOptions) { +export function analyzeScope( + ast: any, + parserOptions: ParserOptions +): ScopeManager { const options = { ignoreEval: true, optimistic: false, diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index df73ab0be631..377a1968376f 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -8,6 +8,7 @@ import { import { analyzeScope } from './analyze-scope'; import { ParserOptions } from './parser-options'; import { visitorKeys } from './visitor-keys'; +import { ScopeManager } from './scope/scope-manager'; // note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder const packageJSON = require('../package.json'); @@ -16,7 +17,7 @@ interface ParseForESLintResult { ast: any; services: ParserServices; visitorKeys: typeof visitorKeys; - scopeManager: ReturnType; + scopeManager: ScopeManager; } function validateBoolean( diff --git a/packages/parser/src/scope/definition.ts b/packages/parser/src/scope/definition.ts new file mode 100644 index 000000000000..0a13d7397659 --- /dev/null +++ b/packages/parser/src/scope/definition.ts @@ -0,0 +1,28 @@ +import { Definition, ParameterDefinition } from 'eslint-scope/lib/definition'; +import { TSESTree } from '@typescript-eslint/typescript-estree'; + +/** + * @class ParameterDefinition + */ +export class TypeDefinition extends Definition { + /** + * Whether the parameter definition is a type definition. + * @member {boolean} ParameterDefinition#typeMode + */ + typeMode: boolean; + + constructor( + type: string, + name: TSESTree.Node, + node: TSESTree.Node, + parent?: TSESTree.Node | null, + index?: number | null, + kind?: string | null + ) { + super(type, name, node, parent, index, kind); + + this.typeMode = true; + } +} + +export { ParameterDefinition, Definition }; diff --git a/packages/parser/src/scope/reference.ts b/packages/parser/src/scope/reference.ts new file mode 100644 index 000000000000..0b6109ad2425 --- /dev/null +++ b/packages/parser/src/scope/reference.ts @@ -0,0 +1,39 @@ +import { Scope } from 'eslint-scope/lib/scope'; +import Reference, { ReferenceFlag } from 'eslint-scope/lib/reference'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; + +/** @internal */ +export function typeReferencing( + scope: Scope, + node: TSESTree.Identifier, + assign?: ReferenceFlag, + writeExpr?: TSESTree.Node | null, + maybeImplicitGlobal?: boolean, + partial?: boolean, + init?: boolean +) { + // 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 Reference( + node, + scope, + assign || Reference.READ, + writeExpr, + maybeImplicitGlobal, + !!partial, + !!init + ); + + ref.typeMode = true; + + scope.references.push(ref); + scope.__left.push(ref); +} diff --git a/packages/parser/src/scope/scope-manager.ts b/packages/parser/src/scope/scope-manager.ts index 49c91d343887..dc205d46dce4 100644 --- a/packages/parser/src/scope/scope-manager.ts +++ b/packages/parser/src/scope/scope-manager.ts @@ -3,7 +3,12 @@ import { TSESTree } from '@typescript-eslint/typescript-estree'; import EslintScopeManager, { ScopeManagerOptions } from 'eslint-scope/lib/scope-manager'; -import { EmptyFunctionScope, EnumScope } from './scopes'; +import { + EmptyFunctionScope, + EnumScope, + InterfaceScope, + TypeAliasScope +} from './scopes'; import { Scope } from 'eslint-scope/lib/scope'; /** @@ -28,4 +33,20 @@ export class ScopeManager extends EslintScopeManager { new EmptyFunctionScope(this, this.__currentScope, node) ); } + + /** @internal */ + __nestInterfaceScope(node: TSESTree.TSInterfaceDeclaration) { + return this.__nestScope( + new InterfaceScope(this, this.__currentScope, node) + ); + } + + /** @internal */ + __nestTypeAliasScope(node: TSESTree.TSTypeAliasDeclaration) { + 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 efb3fc719c70..ed4a85e1167f 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -1,6 +1,33 @@ -import { Scope } from 'eslint-scope/lib/scope'; -import { ScopeManager } from './scope-manager'; +import { Scope as EslintScope } from 'eslint-scope/lib/scope'; import { TSESTree } from '@typescript-eslint/typescript-estree'; +import { ScopeManager } from './scope-manager'; +import { Reference } from 'eslint-scope'; + +export class Scope extends EslintScope { + /** @internal */ + __resolve(ref: 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 Scope { @@ -23,3 +50,25 @@ export class EmptyFunctionScope extends Scope { super(scopeManager, 'empty-function', upperScope, block, false); } } + +export class InterfaceScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.TSInterfaceDeclaration | null + ) { + super(scopeManager, 'interface', upperScope, block, false); + } +} + +export class TypeAliasScope extends Scope { + constructor( + scopeManager: ScopeManager, + upperScope: Scope, + block: TSESTree.TSTypeAliasDeclaration | null + ) { + super(scopeManager, 'type-alias', upperScope, block, false); + } +} + +// TODO: extend all Scopes 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 d18abf288ba1..8ec32a8bfcd6 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": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "propertyKey": Object { + "$ref": 9, + }, + "target": Object { + "$ref": 8, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "target", + "range": Array [ + 59, + 70, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "target", + "range": Array [ + 59, + 70, + ], + "type": "Identifier", + }, + ], + "name": "target", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + Object { + "$id": 9, + "defs": Array [ + Object { + "name": Object { + "name": "propertyKey", + "range": Array [ + 72, + 91, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "propertyKey", + "range": Array [ + 72, + 91, + ], + "type": "Identifier", + }, + ], + "name": "propertyKey", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": 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": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "propertyKey": Object { - "$ref": 9, - }, - "target": Object { - "$ref": 8, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - ], - "name": "target", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 9, - "defs": Array [ - Object { - "name": Object { - "name": "propertyKey", - "range": Array [ - 72, - 91, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "propertyKey", - "range": Array [ - 72, - 91, - ], - "type": "Identifier", - }, - ], - "name": "propertyKey", - "references": Array [], - "scope": Object { - "$ref": 10, - }, - }, - ], - }, - ], + "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 59b060335a70..384bedec44cc 100644 --- a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap @@ -52,7 +52,7 @@ Object { exports[`TSX fixtures/react-typed-props.src 1`] = ` Object { - "$id": 7, + "$id": 10, "block": Object { "range": Array [ 0, @@ -62,7 +62,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -72,7 +72,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, @@ -85,9 +109,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", @@ -99,41 +142,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 { @@ -169,11 +216,11 @@ Object { "name": "props", "references": Array [ Object { - "$ref": 4, + "$ref": 7, }, ], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -185,10 +232,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 10, }, "variableMap": Object { "App": Object { + "$ref": 2, + }, + "Props": Object { "$ref": 1, }, "React": Object { @@ -196,7 +246,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [ Object { @@ -242,11 +292,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 { @@ -282,7 +376,7 @@ Object { "name": "App", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 9, }, }, ], @@ -296,7 +390,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 eeff596aead1..17710915ef46 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 [], } @@ -934,7 +1050,7 @@ Object { exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -944,7 +1060,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -954,7 +1070,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -965,11 +1081,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 { @@ -977,7 +1115,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -1017,7 +1155,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -1026,10 +1164,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 { @@ -1037,7 +1179,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -1077,7 +1219,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -1086,12 +1228,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 [], } @@ -1099,7 +1245,7 @@ Object { exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -1109,7 +1255,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -1117,20 +1263,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, @@ -1141,7 +1357,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -1293,7 +1509,7 @@ Object { exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -1303,7 +1519,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, @@ -1313,7 +1529,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1326,9 +1542,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", @@ -1340,7 +1594,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 1, }, "writeExpr": undefined, }, @@ -1348,19 +1602,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 { @@ -1396,11 +1700,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 1, + "$ref": 4, }, ], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -1412,11 +1716,11 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [], }, @@ -1429,7 +1733,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } @@ -1969,7 +2273,7 @@ Object { exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1979,7 +2283,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -1987,31 +2291,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 [], } @@ -2019,7 +2449,7 @@ Object { exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, @@ -2029,7 +2459,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2037,31 +2467,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 [], } @@ -2168,7 +2796,7 @@ Object { exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -2178,7 +2806,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -2193,7 +2821,7 @@ Object { Object { "$id": 0, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "x", @@ -2207,19 +2835,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 [], }, @@ -2231,12 +2879,15 @@ Object { Object { "$ref": 0, }, + Object { + "$ref": 1, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -3739,7 +4390,7 @@ Object { exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -3749,7 +4400,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -3759,7 +4410,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -3769,7 +4420,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 23, @@ -3784,15 +4435,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 { @@ -3803,13 +4457,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, @@ -3824,26 +4518,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, }, }, ], @@ -3855,7 +4592,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "C": Object { @@ -3863,7 +4600,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -3903,7 +4640,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -3915,7 +4652,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -3923,7 +4660,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -3963,7 +4700,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -3977,7 +4714,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -4399,7 +5136,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -4409,7 +5146,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -4419,7 +5156,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -4434,19 +5171,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 { @@ -4482,7 +5219,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -4494,7 +5231,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", @@ -4513,10 +5267,13 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -4524,7 +5281,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -4564,7 +5321,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -4577,12 +5334,15 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -4590,7 +5350,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -4600,7 +5360,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -4610,7 +5370,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -4625,19 +5385,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 { @@ -4673,7 +5433,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -4683,9 +5443,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", @@ -4702,24 +5479,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 { @@ -4755,7 +5578,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -4766,14 +5589,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 [], } @@ -4781,7 +5607,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, @@ -4791,7 +5617,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, @@ -4801,7 +5627,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, @@ -4816,19 +5642,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 { @@ -4864,7 +5690,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -4874,9 +5700,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", @@ -4893,24 +5770,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 { @@ -4946,7 +5875,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -4957,14 +5886,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 [], } @@ -4972,7 +5910,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -4982,7 +5920,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -4992,7 +5930,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5002,7 +5940,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 20, @@ -5017,15 +5955,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 { @@ -5036,7 +5977,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, }, }, ], @@ -5048,7 +6029,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -5056,7 +6037,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -5096,7 +6077,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -5108,7 +6089,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -5116,7 +6097,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -5156,7 +6137,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -5170,7 +6151,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -5178,7 +6159,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5188,7 +6169,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5198,7 +6179,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5208,7 +6189,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 20, @@ -5219,19 +6200,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 { @@ -5242,7 +6248,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, }, }, ], @@ -5251,10 +6297,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 { @@ -5262,7 +6312,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -5302,7 +6352,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -5311,10 +6361,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 { @@ -5322,7 +6376,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -5362,7 +6416,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -5371,12 +6425,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 [], } @@ -5384,7 +6442,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5394,7 +6452,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5404,7 +6462,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -5419,19 +6477,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 { @@ -5467,7 +6525,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -5475,11 +6533,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 { @@ -5487,7 +6567,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -5527,7 +6607,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -5536,12 +6616,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 [], } @@ -5549,7 +6633,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5559,7 +6643,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5569,7 +6653,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5584,19 +6668,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 { @@ -5632,7 +6716,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -5644,7 +6728,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", @@ -5663,10 +6764,13 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -5674,7 +6778,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -5714,7 +6818,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -5727,12 +6831,15 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -5740,7 +6847,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5750,7 +6857,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5760,7 +6867,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5775,19 +6882,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 { @@ -5823,7 +6930,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -5831,11 +6938,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 { @@ -5843,7 +6992,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -5883,7 +7032,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -5892,12 +7041,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 [], } @@ -5905,7 +7061,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5915,7 +7071,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5925,7 +7081,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5940,19 +7096,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 { @@ -5988,7 +7144,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -5996,11 +7152,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 { @@ -6008,7 +7226,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -6048,7 +7266,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -6057,12 +7275,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 [], } @@ -6070,7 +7298,7 @@ Object { exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -6080,7 +7308,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -6090,7 +7318,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -6115,7 +7343,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -6140,7 +7368,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 35, @@ -6155,15 +7383,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 { @@ -6174,13 +7405,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, @@ -6195,26 +7466,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, }, }, ], @@ -6226,7 +7497,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -6234,7 +7505,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -6274,7 +7545,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -6286,7 +7557,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "C": Object { @@ -6294,7 +7565,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -6334,7 +7605,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -6348,7 +7619,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -6356,7 +7627,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 15, + "$id": 26, "block": Object { "range": Array [ 0, @@ -6366,7 +7637,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 25, "block": Object { "range": Array [ 0, @@ -6376,7 +7647,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 15, "block": Object { "range": Array [ 0, @@ -6386,7 +7657,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 14, "block": Object { "range": Array [ 60, @@ -6401,11 +7672,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 15, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 15, }, "variables": Array [], }, @@ -6414,10 +7685,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 [ @@ -6428,41 +7737,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 { @@ -6498,17 +7858,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, @@ -6523,19 +7883,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 { @@ -6571,13 +7931,13 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 17, }, }, ], }, Object { - "$id": 13, + "$id": 19, "block": Object { "range": Array [ 130, @@ -6592,19 +7952,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 { @@ -6640,7 +8000,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, }, }, ], @@ -6650,9 +8148,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", @@ -6669,9 +8186,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 7, "from": Object { - "$ref": 14, + "$ref": 25, }, "identifier": Object { "name": "C", @@ -6688,15 +8205,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, }, @@ -6705,7 +8232,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { @@ -6745,11 +8272,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 14, + "$ref": 25, }, }, Object { @@ -6789,7 +8316,7 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 25, }, }, Object { @@ -6829,11 +8356,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, }, }, ], @@ -6842,12 +8457,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 [], } @@ -6855,7 +8474,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, @@ -6865,7 +8484,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, @@ -6875,7 +8494,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6886,14 +8505,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 { @@ -6901,7 +8586,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 7, }, "variables": Array [ Object { @@ -6912,11 +8597,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 { @@ -6952,7 +8681,7 @@ Object { "name": "Base", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -6961,10 +8690,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 { @@ -6972,7 +8705,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -7010,9 +8743,13 @@ Object { }, ], "name": "M", - "references": Array [], + "references": Array [ + Object { + "$ref": 5, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -7021,12 +8758,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 [], } @@ -10244,7 +11985,7 @@ Object { exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -10254,7 +11995,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -10264,7 +12005,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -10274,7 +12015,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 25, @@ -10289,15 +12030,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 { @@ -10308,13 +12052,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, @@ -10329,26 +12113,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, }, }, ], @@ -10360,7 +12187,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "A": Object { @@ -10368,7 +12195,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -10408,7 +12235,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -10420,7 +12247,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "A": Object { @@ -10428,7 +12255,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -10468,7 +12295,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -10482,7 +12309,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -10490,7 +12317,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -10500,7 +12327,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -10510,7 +12337,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -10525,19 +12352,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 { @@ -10573,7 +12400,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -10585,19 +12412,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 { @@ -10633,7 +12503,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -10647,7 +12517,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -10655,7 +12525,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -10665,7 +12535,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -10675,7 +12545,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -10690,19 +12560,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 { @@ -10738,7 +12608,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -10746,23 +12616,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 { @@ -10798,7 +12733,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -10807,12 +12742,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 [], } @@ -10820,7 +12759,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -10830,7 +12769,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -10840,7 +12779,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -10855,19 +12794,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 { @@ -10903,7 +12842,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -10915,19 +12854,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 { @@ -10963,7 +12945,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -10977,7 +12959,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -13467,7 +15449,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -13477,7 +15459,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -13487,7 +15469,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 15, @@ -13502,11 +15484,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -13517,13 +15499,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, @@ -13534,7 +15561,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -13542,7 +15569,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -13552,7 +15579,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -13562,7 +15589,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 15, @@ -13577,11 +15604,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -13592,13 +15619,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, @@ -13609,7 +15724,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -13617,7 +15732,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -13627,7 +15742,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -13637,7 +15752,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -13652,19 +15767,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 { @@ -13700,7 +15815,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -13712,19 +15827,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 { @@ -13760,7 +15918,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -13774,7 +15932,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -13782,7 +15940,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -13792,7 +15950,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -13802,7 +15960,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 7, @@ -13817,19 +15975,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 { @@ -13865,7 +16023,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -13877,19 +16035,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 { @@ -13925,7 +16169,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -13939,7 +16183,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -14185,7 +16429,7 @@ Object { exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14195,7 +16439,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -14203,20 +16447,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, @@ -14227,7 +16541,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -14235,7 +16549,7 @@ Object { exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14245,7 +16559,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -14253,20 +16567,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, @@ -14277,7 +16661,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -14285,7 +16669,7 @@ Object { exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -14295,7 +16679,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14303,31 +16687,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 [], } @@ -14335,7 +16819,7 @@ Object { exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -14345,7 +16829,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -14355,7 +16839,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 10, @@ -14368,9 +16852,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "a", @@ -14382,7 +16866,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 4, }, "writeExpr": undefined, }, @@ -14390,18 +16874,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 { @@ -14412,11 +16899,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 { @@ -14452,11 +16979,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -14468,7 +16995,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "obj", @@ -14494,7 +17021,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "obj": Object { @@ -14502,7 +17029,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -14552,7 +17079,7 @@ Object { }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -14566,7 +17093,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } @@ -15734,7 +18261,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -15744,7 +18271,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -15754,7 +18281,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -15767,9 +18294,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", @@ -15781,7 +18346,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, @@ -15789,18 +18354,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 { @@ -15811,11 +18379,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 { @@ -15851,11 +18466,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -15867,7 +18482,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -15875,7 +18490,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { @@ -15915,7 +18530,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -15929,7 +18544,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [], } @@ -15937,7 +18552,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, @@ -15947,7 +18562,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -15957,7 +18572,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15972,15 +18587,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 { @@ -15991,7 +18609,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, }, }, ], @@ -16003,7 +18661,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "compare": Object { @@ -16011,7 +18669,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -16051,7 +18709,7 @@ Object { "name": "compare", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -16065,7 +18723,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -16073,7 +18731,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -16083,7 +18741,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -16093,7 +18751,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16106,9 +18764,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", @@ -16120,7 +18816,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, @@ -16128,18 +18824,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 { @@ -16150,11 +18849,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 { @@ -16190,11 +18936,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -16206,7 +18952,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -16214,7 +18960,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { @@ -16254,7 +19000,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -16268,7 +19014,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [], } @@ -16479,7 +19225,7 @@ Object { exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -16489,7 +19235,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -16499,7 +19245,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -16514,7 +19260,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "age", @@ -16539,7 +19285,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", @@ -16556,10 +19319,14 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "age": Object { @@ -16576,7 +19343,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -16587,7 +19354,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -16627,11 +19394,11 @@ Object { "name": "name", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -16675,7 +19442,7 @@ Object { }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -16715,7 +19482,7 @@ Object { "name": "args", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -16724,10 +19491,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 { @@ -16735,7 +19506,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -16775,7 +19546,7 @@ Object { "name": "message", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -16784,12 +19555,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 [], } @@ -16987,7 +19762,7 @@ Object { exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16997,7 +19772,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -17005,31 +19780,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 [], } @@ -17037,7 +20005,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, @@ -17047,7 +20015,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17055,31 +20023,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 [], } @@ -17087,7 +20181,7 @@ Object { exports[`typescript fixtures/basics/interface-extends.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17097,7 +20191,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17105,216 +20199,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 {}, - "variableScope": Object { - "$ref": 0, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 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", + "variableScope": Object { + "$ref": 3, }, - "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, - 297, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 297, + 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 [ - 192, - 195, - ], - "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, }, @@ -17324,22 +20430,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, }, @@ -17351,146 +20499,159 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 34, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 34, + 22, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "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-type-parameters.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", + "$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, @@ -17501,46 +20662,3729 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 1, + "$id": 23, "block": Object { "range": Array [ 0, - 22, + 297, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 22, "block": Object { "range": Array [ 0, - 22, + 297, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], + "childScopes": Array [ + Object { + "$id": 21, + "block": Object { + "range": Array [ + 0, + 295, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "bax", + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "eee", + "range": Array [ + 95, + 106, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "fff", + "range": Array [ + 122, + 134, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 171, + 172, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 174, + 175, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 177, + 178, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "loo", + "range": Array [ + 192, + 195, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 198, + 199, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 201, + 202, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 225, + 226, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 228, + 229, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 16, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 231, + 232, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 17, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 250, + 251, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 18, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 253, + 255, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 19, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 278, + 279, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 20, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 281, + 283, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, + Object { + "$ref": 19, + }, + Object { + "$ref": 20, + }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 22, + }, + "variableMap": Object { + "F": Object { + "$ref": 2, + }, + "J": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 22, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "J", + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 221, + 224, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "J", + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + }, + ], + "name": "J", + "references": Array [], + "scope": Object { + "$ref": 21, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "F", + "range": Array [ + 275, + 276, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 274, + 277, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "F", + "range": Array [ + 275, + 276, + ], + "type": "Identifier", + }, + ], + "name": "F", + "references": Array [], + "scope": Object { + "$ref": 21, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, + Object { + "$ref": 19, + }, + Object { + "$ref": 20, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 23, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 22, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 295, + ], + "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": 22, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, + Object { + "$ref": 19, + }, + Object { + "$ref": 20, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 23, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "y", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "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 { + "Test": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 33, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "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 { + "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, + 33, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 36, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "J", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "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": 1, + }, + "T": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "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, + "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/interface-with-generic.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "T": Object { + "$ref": 0, + }, + "Test": Object { + "$ref": 1, + }, + }, + "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, + }, + }, + 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, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 88, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 88, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 87, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "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", + }, + "node": Object { + "range": Array [ + 0, + 87, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + 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, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", + "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, + }, + 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 [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + 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 [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 81, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + 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-without-type-annotation.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "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 { + "test": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$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, + 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, + "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": 2, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "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 { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "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 [ + 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": 5, + }, + "variableMap": Object { + "nestedArray": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "nestedArray", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "nestedArray", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + ], + "name": "nestedArray", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "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, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 46, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 46, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "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 { + "name": Object { + "name": "x", + "range": Array [ + 6, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 6, + 17, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 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/non-null-assertion-operator.src 1`] = ` +Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "Entity", + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "validateEntity", + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "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": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "e": Object { + "$ref": 2, + }, + "s": Object { + "$ref": 3, + }, + }, + "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": "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": 6, + }, + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + 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": 7, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "processEntity": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processEntity", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processEntity", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, + ], + "name": "processEntity", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + "y": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 11, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 17, + 29, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 13, + 30, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + }, + ], + "name": "y", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 26, + 31, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + Object { + "$id": 4, + "block": Object { + "range": Array [ + 58, + 81, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "X": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 81, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "X": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 81, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` +Object { + "$id": 14, + "block": Object { + "range": Array [ + 0, + 176, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 13, + "block": Object { + "range": Array [ + 0, + 176, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 29, + 61, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "T": Object { + "$ref": 3, + }, + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "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": 7, + "block": Object { + "range": Array [ + 68, + 100, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "T": Object { + "$ref": 6, + }, + "arguments": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 5, + "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, + }, + }, + ], + }, + Object { + "$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 { + "$id": 8, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + Object { + "$id": 12, + "block": Object { + "range": Array [ + 147, + 172, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 10, + }, + "x": Object { + "$ref": 11, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ + Object { + "$id": 10, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 11, + "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": 12, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$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": 1, + "$ref": 14, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 13, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 174, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 175, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -17551,19 +24395,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 14, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` +exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` Object { "$id": 1, "block": Object { "range": Array [ - 0, - 88, + 45, + 60, ], "type": "Program", }, @@ -17572,8 +24416,8 @@ Object { "$id": 0, "block": Object { "range": Array [ - 0, - 88, + 45, + 60, ], "type": "Program", }, @@ -17594,7 +24438,7 @@ Object { }, ], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "global", @@ -17607,140 +24451,807 @@ Object { } `; -exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` +exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, - 62, + 42, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 5, "block": Object { "range": Array [ 0, - 62, + 42, ], "type": "Program", }, - "childScopes": Array [], + "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 [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 6, + }, + "variableMap": Object { + "test": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 5, }, - "variables": Array [], + "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 [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, - 82, + 48, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, - 82, + 48, ], "type": "Program", }, - "childScopes": Array [], + "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 [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 7, + }, + "variableMap": Object { + "Result": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$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, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` +exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 28, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 28, + 31, ], "type": "Program", }, - "childScopes": Array [], + "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": 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, + 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, @@ -17751,46 +25262,127 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 20, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 20, + 29, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 27, + ], + "type": "TSTypeAssertion", + }, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 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 [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -17801,48 +25393,168 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-arrow-function.src 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, - 44, + 45, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 44, + 45, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 22, + 42, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "n", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "n": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "n", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 22, + 42, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "n", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + ], + "name": "n", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "asserted2", + "range": Array [ + 4, + 13, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 16, + 43, + ], + "type": "TSTypeAssertion", + }, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { - "nestedArray": Object { + "asserted2": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -17850,17 +25562,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "nestedArray", + "name": "asserted2", "range": Array [ 4, - 44, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 44, + 43, ], "type": "VariableDeclarator", }, @@ -17877,18 +25589,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "nestedArray", + "name": "asserted2", "range": Array [ 4, - 44, + 13, ], "type": "Identifier", }, ], - "name": "nestedArray", - "references": Array [], + "name": "asserted2", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 5, }, }, ], @@ -17902,70 +25618,190 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +exports[`typescript fixtures/basics/type-guard-in-arrow-function.src 1`] = ` Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, - 46, + 79, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, - 46, + 79, ], "type": "Program", }, - "childScopes": Array [], + "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": 2, + "$ref": 6, }, "identifier": Object { - "name": "Observable", + "name": "isString", "range": Array [ - 19, - 29, + 6, + 14, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 17, + 78, + ], + "type": "ArrowFunctionExpression", + }, }, ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 7, }, "variableMap": Object { - "x": Object { + "isString": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [ Object { @@ -17973,24 +25809,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "isString", "range": Array [ 6, - 17, + 14, ], "type": "Identifier", }, "node": Object { "range": Array [ 6, - 17, + 78, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 18, + 78, ], "type": "VariableDeclaration", }, @@ -18000,18 +25836,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "isString", "range": Array [ 6, - 17, + 14, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "isString", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 2, + "$ref": 6, }, }, ], @@ -18020,48 +25860,44 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` +exports[`typescript fixtures/basics/type-guard-in-function.src 1`] = ` Object { - "$id": 10, + "$id": 7, "block": Object { "range": Array [ 0, - 82, + 75, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 6, "block": Object { "range": Array [ 0, - 82, + 75, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 82, + 75, ], "type": "FunctionDeclaration", }, @@ -18070,32 +25906,15 @@ Object { "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, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 5, }, "identifier": Object { - "name": "e", + "name": "x", "range": Array [ - 56, - 57, + 27, + 28, ], "type": "Identifier", }, @@ -18106,40 +25925,15 @@ Object { "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, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 5, }, "identifier": Object { - "name": "e", + "name": "x", "range": Array [ - 72, - 73, + 59, + 60, ], "type": "Identifier", }, @@ -18150,28 +25944,21 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 6, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, - "e": Object { + "x": Object { "$ref": 2, }, - "s": Object { - "$ref": 3, - }, }, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, "variables": Array [ Object { @@ -18182,7 +25969,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 5, }, }, Object { @@ -18190,17 +25977,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "e", + "name": "x", "range": Array [ - 23, - 33, + 18, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 75, ], "type": "FunctionDeclaration", }, @@ -18211,78 +25998,190 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "e", + "name": "x", "range": Array [ - 23, - 33, + 18, + 24, ], "type": "Identifier", }, ], - "name": "e", + "name": "x", "references": Array [ Object { - "$ref": 5, + "$ref": 3, }, Object { - "$ref": 7, + "$ref": 4, }, ], "scope": Object { - "$ref": 8, + "$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 { - "$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, - }, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], + "type": "interface", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -18290,20 +26189,23 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 5, }, "variableMap": Object { - "processEntity": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 4, }, "variables": Array [ Object { @@ -18311,39 +26213,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processEntity", + "name": "Foo", "range": Array [ - 9, - 22, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 56, ], - "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": 4, }, }, ], @@ -18354,150 +26256,288 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, + }, + Object { + "$ref": 2, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +exports[`typescript fixtures/basics/type-guard-in-method.src 1`] = ` Object { - "$id": 3, + "$id": 9, "block": Object { "range": Array [ 0, - 30, + 148, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 8, "block": Object { "range": Array [ 0, - 30, + 148, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 7, + "block": Object { + "range": Array [ + 0, + 147, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "x", + "$id": 4, + "block": Object { "range": Array [ - 4, - 11, + 19, + 75, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", + "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, }, - "parent": Object { + "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 [ - 0, - 12, + 86, + 145, ], - "type": "VariableDeclaration", + "type": "ArrowFunctionExpression", }, - "type": "Variable", + "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 [], }, ], - "eslintUsed": undefined, - "identifiers": 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 { - "name": "x", - "range": Array [ - 4, - 11, + "$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", + }, ], - "type": "Identifier", + "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, + }, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, }, + ], + "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": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "y", + "name": "Foo", "range": Array [ - 17, - 29, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 17, - 29, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 13, - 30, + 0, + 147, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "y", + "name": "Foo", "range": Array [ - 17, - 29, + 6, + 9, ], "type": "Identifier", }, ], - "name": "y", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 8, }, }, ], @@ -18511,41 +26551,41 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 9, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` Object { - "$id": 6, + "$id": 12, "block": Object { "range": Array [ 0, - 82, + 138, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 11, "block": Object { "range": Array [ 0, - 82, + 138, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ - 26, - 31, + 44, + 87, ], - "type": "FunctionExpression", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, @@ -18554,95 +26594,174 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 11, }, "variableMap": Object { + "A": Object { + "$ref": 5, + }, "arguments": Object { - "$ref": 1, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [ Object { - "$id": 1, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$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": 4, + "$id": 10, "block": Object { "range": Array [ - 58, - 81, + 88, + 137, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", + "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": 5, + "$ref": 11, }, "variableMap": Object { - "X": Object { - "$ref": 3, + "A": Object { + "$ref": 8, + }, + "arguments": Object { + "$ref": 7, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 10, }, "variables": Array [ Object { - "$id": 3, + "$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": "X", + "name": "A", "range": Array [ - 64, - 65, + 112, + 113, ], "type": "Identifier", }, "node": Object { "range": Array [ - 58, - 81, + 100, + 131, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "A", "range": Array [ - 64, - 65, + 112, + 113, ], "type": "Identifier", }, ], - "name": "X", + "name": "A", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 10, }, }, ], @@ -18650,19 +26769,67 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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": 6, + "$ref": 12, }, "variableMap": Object { - "X": Object { + "bar": Object { "$ref": 0, }, + "baz": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 5, + "$ref": 11, }, "variables": Array [ Object { @@ -18670,39 +26837,79 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "bar", "range": Array [ - 64, - 65, + 53, + 56, ], "type": "Identifier", }, "node": Object { "range": Array [ - 58, - 81, + 44, + 87, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "bar", "range": Array [ - 64, - 65, + 53, + 56, ], "type": "Identifier", }, ], - "name": "X", + "name": "bar", "references": Array [], "scope": Object { - "$ref": 5, + "$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, }, }, ], @@ -18711,283 +26918,431 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 9, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 12, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` +exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 12, + "$id": 20, "block": Object { "range": Array [ 0, - 176, + 339, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 19, "block": Object { "range": Array [ 0, - 176, + 339, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 10, "block": Object { "range": Array [ - 29, - 61, + 0, + 74, ], - "type": "FunctionExpression", + "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", "upperScope": Object { - "$ref": 11, + "$ref": 19, }, "variableMap": Object { - "arguments": Object { - "$ref": 2, + "foo": Object { + "$ref": 9, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 19, }, "variables": Array [ Object { - "$id": 2, - "defs": Array [], + "$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 [], - "name": "arguments", + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 10, }, }, ], }, Object { - "$id": 5, + "$id": 12, "block": Object { "range": Array [ - 68, - 100, + 75, + 164, ], - "type": "FunctionExpression", + "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", "upperScope": Object { - "$ref": 11, + "$ref": 19, }, "variableMap": Object { - "arguments": Object { - "$ref": 4, + "foo2": Object { + "$ref": 11, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 19, }, "variables": Array [ Object { - "$id": 4, - "defs": Array [], + "$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 [], - "name": "arguments", + "identifiers": Array [ + Object { + "name": "foo2", + "range": Array [ + 81, + 85, + ], + "type": "Identifier", + }, + ], + "name": "foo2", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 12, }, }, ], }, Object { - "$id": 7, + "$id": 15, "block": Object { "range": Array [ - 109, - 138, + 165, + 244, ], - "type": "FunctionExpression", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, + "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, }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, + "$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": 10, + "$id": 18, "block": Object { "range": Array [ - 147, - 172, + 245, + 338, ], - "type": "FunctionExpression", + "type": "TSInterfaceDeclaration", }, "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": 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": 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, + "$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": 1, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 19, }, "identifier": Object { - "name": "foo", + "name": "A", "range": Array [ - 6, - 9, + 59, + 60, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { "$ref": 0, }, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "bar", "range": Array [ - 12, - 174, + 43, + 46, ], - "type": "ObjectExpression", + "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": 12, + "$ref": 20, }, "variableMap": Object { - "foo": Object { + "A": Object { "$ref": 0, }, + "bar": Object { + "$ref": 3, + }, + "bar2": Object { + "$ref": 4, + }, + "foo": Object { + "$ref": 1, + }, + "foo2": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 11, + "$ref": 19, }, "variables": Array [ Object { @@ -18995,28 +27350,156 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "A", "range": Array [ - 6, - 9, + 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, - 174, + 9, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "node": Object { "range": Array [ 0, - 175, + 74, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, @@ -19031,13 +27514,143 @@ Object { }, ], "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": 1, + "$ref": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 16, }, ], "scope": Object { - "$ref": 11, + "$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, }, }, ], @@ -19051,69 +27664,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, - }, - "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": 20, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 42, + 78, ], "type": "Program", }, @@ -19123,7 +27686,7 @@ Object { "block": Object { "range": Array [ 0, - 42, + 78, ], "type": "Program", }, @@ -19133,77 +27696,85 @@ Object { "block": Object { "range": Array [ 0, - 42, + 77, ], - "type": "FunctionDeclaration", + "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 { - "abc": Object { - "$ref": 2, - }, - "arguments": Object { + "AudioBufferList": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 2, "defs": Array [ Object { "name": Object { - "name": "abc", + "name": "AudioBufferList", "range": Array [ - 14, - 38, + 6, + 21, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 42, + 77, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "abc", + "name": "AudioBufferList", "range": Array [ - 14, - 38, + 6, + 21, ], "type": "Identifier", }, ], - "name": "abc", + "name": "AudioBufferList", "references": Array [], "scope": Object { "$ref": 3, @@ -19215,13 +27786,17 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "test": Object { + "AudioBufferList": Object { "$ref": 0, }, }, @@ -19234,36 +27809,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "test", + "name": "AudioBufferList", "range": Array [ - 9, - 13, + 6, + 21, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 42, + 77, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "test", + "name": "AudioBufferList", "range": Array [ - 9, - 13, + 6, + 21, ], "type": "Identifier", }, ], - "name": "test", + "name": "AudioBufferList", "references": Array [], "scope": Object { "$ref": 4, @@ -19275,101 +27850,125 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 2, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 48, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 48, + 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, @@ -19380,46 +27979,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 31, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 31, + 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, @@ -19430,19 +28099,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 29, + 17, ], "type": "Program", }, @@ -19452,47 +28121,46 @@ Object { "block": Object { "range": Array [ 0, - 29, + 17, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", + "block": Object { "range": Array [ - 6, - 9, + 0, + 16, ], - "type": "Identifier", + "type": "TSTypeAliasDeclaration", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 2, }, - "writeExpr": Object { - "range": Array [ - 12, - 27, - ], - "type": "TSTypeAssertion", + "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 { + "Foo": Object { "$ref": 0, }, }, @@ -19505,47 +28173,37 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 28, + 16, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { "$ref": 2, }, @@ -19567,162 +28225,67 @@ Object { } `; -exports[`typescript fixtures/basics/type-assertion-arrow-function.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 45, + 17, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 45, + 17, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ - 22, - 42, + 0, + 16, ], - "type": "ArrowFunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "n", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "n": Object { - "$ref": 2, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "n", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 42, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "n", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - ], - "name": "n", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "asserted2", - "range": Array [ - 4, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 16, - 43, - ], - "type": "TSTypeAssertion", - }, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 3, }, "variableMap": Object { - "asserted2": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -19730,49 +28293,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "asserted2", + "name": "Foo", "range": Array [ - 4, - 13, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 43, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 44, + 16, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "asserted2", + "name": "Foo", "range": Array [ - 4, - 13, + 5, + 8, ], "type": "Identifier", }, ], - "name": "asserted2", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -19786,168 +28339,193 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-guard-in-arrow-function.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 79, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 79, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ - 17, - 78, + 0, + 15, ], - "type": "ArrowFunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "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 { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "x", + "name": Object { + "name": "Foo", "range": Array [ - 62, - 63, + 5, + 8, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", }, - "writeExpr": undefined, + "parent": null, + "type": "TypeAliasName", }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "x": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ + "eslintUsed": undefined, + "identifiers": 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, - }, + "name": "Foo", + "range": Array [ + 5, + 8, ], - "scope": Object { - "$ref": 4, - }, + "type": "Identifier", }, ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + }, + ], + "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, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "isString", + "block": Object { "range": Array [ - 6, - 14, + 0, + 17, ], - "type": "Identifier", + "type": "TSTypeAliasDeclaration", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 2, }, - "writeExpr": Object { - "range": Array [ - 17, - 78, - ], - "type": "ArrowFunctionExpression", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, }, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "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 { @@ -19955,49 +28533,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, }, }, ], @@ -20011,139 +28579,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-object.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, @@ -20152,15 +28637,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 { @@ -20168,39 +28653,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, }, }, ], @@ -20214,46 +28699,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-guard-in-interface.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 57, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 57, + 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, @@ -20264,221 +28819,56 @@ Object { "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-symbol.src 1`] = ` Object { - "$id": 9, + "$id": 3, "block": Object { "range": Array [ 0, - 148, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 2, "block": Object { "range": Array [ 0, - 148, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 1, "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, - }, - }, - ], + 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, @@ -20487,7 +28877,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -20495,7 +28885,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 2, }, "variables": Array [ Object { @@ -20505,20 +28895,20 @@ Object { "name": Object { "name": "Foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 147, + 17, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -20526,8 +28916,8 @@ Object { Object { "name": "Foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, @@ -20535,7 +28925,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 2, }, }, ], @@ -20549,154 +28939,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-true.src 1`] = ` Object { - "$id": 8, + "$id": 3, "block": Object { "range": Array [ 0, - 138, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 2, "block": Object { "range": Array [ 0, - 138, + 16, ], "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, + 15, ], - "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 { @@ -20704,79 +29013,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, + 15, ], - "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-undefined.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "Program", + }, + "childScopes": Array [ Object { "$id": 1, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "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, + 20, ], - "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, }, }, ], @@ -20785,241 +29174,198 @@ 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-unknown.src 1`] = ` Object { - "$id": 9, + "$id": 3, "block": Object { "range": Array [ 0, - 339, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 2, "block": Object { "range": Array [ 0, - 339, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ 0, - 74, + 18, ], - "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 { - "foo": Object { - "$ref": 4, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 2, }, - "variables": Array [ + "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 { - "$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, + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSTypeAliasDeclaration", }, + "parent": null, + "type": "TypeAliasName", }, ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 75, - 164, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "foo2": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ + "eslintUsed": undefined, + "identifiers": 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": "Foo", + "range": Array [ + 5, + 8, ], - "name": "foo2", - "references": Array [], - "scope": Object { - "$ref": 7, - }, + "type": "Identifier", }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 43, - 46, - ], - "type": "Identifier", + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "bar", + ], + }, + ], + "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-void.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { "range": Array [ - 133, - 136, + 0, + 15, ], - "type": "Identifier", + "type": "TSTypeAliasDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "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": 9, + "$ref": 3, }, "variableMap": Object { - "foo": Object { + "Foo": Object { "$ref": 0, }, - "foo2": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 8, + "$ref": 2, }, "variables": Array [ Object { @@ -21027,79 +29373,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, }, }, ], @@ -21108,70 +29414,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 { @@ -21179,39 +29558,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, }, }, ], @@ -21220,18 +29606,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 { @@ -21239,39 +29632,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, }, }, ], @@ -21280,251 +29673,356 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 2, }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` +exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, - 17, + 90, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, - 17, + 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-null.src 1`] = ` +exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 16, + 24, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 16, + 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, @@ -21535,15 +30033,15 @@ Object { "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/unknown-type-annotation.src 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -21553,7 +30051,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -21568,13 +30066,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, @@ -21585,29 +30134,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` +exports[`typescript fixtures/basics/var-with-definite-assignment.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 18, + 50, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 18, + 50, ], "type": "Program", }, @@ -21618,13 +30167,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, @@ -21635,96 +30333,332 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` +exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 18, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 18, + 16, ], "type": "Program", }, "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-symbol.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, @@ -21735,29 +30669,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` +exports[`typescript fixtures/basics/variable-declaration-type-annotation-spacing.src 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 16, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, - 16, + 22, ], "type": "Program", }, @@ -21768,13 +30702,64 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 2, + }, + "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, @@ -21785,46 +30770,161 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` +exports[`typescript fixtures/declare/abstract-class.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 21, + 32, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 21, + 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, @@ -21835,46 +30935,161 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` +exports[`typescript fixtures/declare/class.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 19, + 23, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 19, + 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, @@ -21885,46 +31100,204 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` +exports[`typescript fixtures/declare/enum.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 16, + 38, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, - 16, + 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, + "$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 [ + 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, @@ -21935,46 +31308,116 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` +exports[`typescript fixtures/declare/function.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 58, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 58, + 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, @@ -21985,46 +31428,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/interface.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 90, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 90, + 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, @@ -22035,15 +31548,15 @@ 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/module.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22053,7 +31566,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22061,20 +31574,90 @@ Object { ], "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, @@ -22085,48 +31668,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/namespace.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 18, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 18, + 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": 2, + "$ref": 3, }, "variableMap": Object { - "foo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22134,45 +31742,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Foo", "range": Array [ - 4, - 16, + 18, + 21, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 17, + 26, ], - "type": "VariableDeclaration", + "type": "TSModuleDeclaration", }, - "type": "Variable", + "parent": null, + "type": "NamespaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Foo", "range": Array [ - 4, - 16, + 18, + 21, ], "type": "Identifier", }, ], - "name": "foo", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22186,54 +31788,73 @@ 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/type-alias.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 50, + 26, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 50, + 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": 4, + "$ref": 3, }, "variableMap": Object { - "x": Object { + "Foo": Object { "$ref": 0, }, - "y": Object { - "$ref": 1, - }, - "z": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -22241,137 +31862,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "Foo", "range": Array [ - 6, + 13, 16, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 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": "x", + "name": "Foo", "range": Array [ - 6, + 13, 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", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -22385,19 +31908,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` +exports[`typescript fixtures/declare/variable.src 1`] = ` Object { "$id": 2, "block": Object { "range": Array [ 0, - 16, + 22, ], "type": "Program", }, @@ -22407,7 +31930,7 @@ Object { "block": Object { "range": Array [ 0, - 16, + 22, ], "type": "Program", }, @@ -22436,22 +31959,22 @@ Object { "name": Object { "name": "foo", "range": Array [ - 4, - 14, + 12, + 20, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 14, + 12, + 20, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 15, + 21, ], "type": "VariableDeclaration", }, @@ -22463,8 +31986,8 @@ Object { Object { "name": "foo", "range": Array [ - 4, - 14, + 12, + 20, ], "type": "Identifier", }, @@ -22492,251 +32015,179 @@ Object { } `; -exports[`typescript fixtures/basics/var-with-type.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, - 55, + 72, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 55, + 72, ], "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, + 72, ], - "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, + 48, + 70, ], - "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": "configurable", "range": Array [ - 30, - 54, + 19, + 31, ], - "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 [ - Object { - "$ref": 3, + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Point": Object { + "$ref": 1, }, - ], - "scope": Object { - "$ref": 4, }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/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 [], + "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 [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 7, }, "variableMap": Object { - "x": Object { + "Point": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [ Object { @@ -22744,45 +32195,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "Point", "range": Array [ - 4, - 21, + 6, + 11, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 72, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "Point", "range": Array [ - 4, - 21, + 6, + 11, ], "type": "Identifier", }, ], - "name": "x", + "name": "Point", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 6, }, }, ], @@ -22791,63 +32236,130 @@ 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-factory-static-member.src 1`] = ` Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, - 32, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 32, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 31, + 82, ], "type": "ClassDeclaration", }, - "childScopes": Array [], + "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 [], - "throughReferences": Array [], + "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": 3, + "$ref": 6, }, "variableMap": Object { - "Foo": Object { + "Other": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -22855,17 +32367,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "Other", "range": Array [ - 23, - 26, + 6, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 31, + 82, ], "type": "ClassDeclaration", }, @@ -22876,18 +32388,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "Other", "range": Array [ - 23, - 26, + 6, + 11, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "Other", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -22896,18 +32408,22 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "Other": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -22915,17 +32431,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "Other", "range": Array [ - 23, - 26, + 6, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 31, + 82, ], "type": "ClassDeclaration", }, @@ -22936,18 +32452,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "Other", "range": Array [ - 23, - 26, + 6, + 11, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "Other", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -22956,63 +32472,130 @@ 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/declare/class.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = ` Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, - 23, + 55, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 23, + 55, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 22, + 55, ], "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 31, + 53, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "hidden", + "range": Array [ + 15, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 6, }, "variableMap": Object { - "Foo": Object { + "P": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -23020,17 +32603,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "P", "range": Array [ - 14, - 17, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 22, + 55, ], "type": "ClassDeclaration", }, @@ -23041,18 +32624,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "P", "range": Array [ - 14, - 17, + 6, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "P", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -23061,18 +32644,22 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "P": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -23080,17 +32667,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "P", "range": Array [ - 14, - 17, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 22, + 55, ], "type": "ClassDeclaration", }, @@ -23101,18 +32688,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "P", "range": Array [ - 14, - 17, + 6, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "P", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -23121,66 +32708,197 @@ 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/declare/enum.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = ` Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, - 38, + 78, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, - 38, + 78, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, - 37, + 78, ], - "type": "TSEnumDeclaration", + "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 [], - "type": "enum", + "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": 4, + "$ref": 8, }, "variableMap": Object { - "Bar": Object { + "User": Object { "$ref": 1, }, - "Baz": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -23188,79 +32906,39 @@ Object { "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": "User", "range": Array [ - 32, - 35, + 6, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 35, + 0, + 78, ], - "type": "TSEnumMember", + "type": "ClassDeclaration", }, "parent": undefined, - "type": "EnumMemberName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Baz", + "name": "User", "range": Array [ - 32, - 35, + 6, + 10, ], "type": "Identifier", }, ], - "name": "Baz", + "name": "User", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -23269,18 +32947,22 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object { - "Foo": Object { + "User": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -23288,39 +32970,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "User", "range": Array [ - 13, - 16, + 6, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 37, + 78, ], - "type": "TSEnumDeclaration", + "type": "ClassDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "User", "range": Array [ - 13, - 16, + 6, + 10, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "User", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -23329,78 +33011,149 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 9, }, "variables": Array [], } `; -exports[`typescript fixtures/declare/function.src 1`] = ` +exports[`typescript fixtures/decorators/class-decorators/class-decorator.src 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 29, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 29, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 28, + 20, ], - "type": "TSDeclareFunction", + "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "empty-function", + "type": "class", "upperScope": Object { - "$ref": 2, + "$ref": 4, + }, + "variableMap": Object { + "Qux": Object { + "$ref": 2, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Qux", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 20, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Qux", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + ], + "name": "Qux", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "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": 3, + "$ref": 5, }, "variableMap": Object { - "foo": Object { + "Qux": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [ Object { @@ -23408,39 +33161,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "Qux", "range": Array [ + 14, 17, - 20, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 28, + 20, ], - "type": "TSDeclareFunction", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "Qux", "range": Array [ + 14, 17, - 20, ], "type": "Identifier", }, ], - "name": "foo", + "name": "Qux", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -23449,248 +33202,149 @@ 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/interface.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": 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 [], + "$ref": 1, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/declare/module.src 1`] = ` +exports[`typescript fixtures/decorators/class-decorators/class-decorator-factory.src 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 24, + 58, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 24, + 58, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ - 19, - 23, + 0, + 58, ], - "type": "TSModuleBlock", + "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "class", "upperScope": Object { - "$ref": 2, + "$ref": 4, + }, + "variableMap": Object { + "FooComponent": Object { + "$ref": 2, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ + "variables": Array [ Object { - "name": "Foo", - "range": Array [ - 15, - 18, + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "FooComponent", + "range": Array [ + 43, + 55, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 58, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "FooComponent", + "range": Array [ + 43, + 55, + ], + "type": "Identifier", + }, + ], + "name": "FooComponent", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/declare/namespace.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { "$id": 1, - "block": Object { + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Component", "range": Array [ - 22, - 26, + 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 { @@ -23698,39 +33352,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "FooComponent", "range": Array [ - 18, - 21, + 43, + 55, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 26, + 58, ], - "type": "TSModuleDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "NamespaceName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "FooComponent", "range": Array [ - 18, - 21, + 43, + 55, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "FooComponent", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -23739,103 +33393,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": 1, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/declare/variable.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-instance-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": "onlyRead", + "range": Array [ + 15, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "B": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 7, }, "variableMap": Object { - "foo": Object { + "B": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [ Object { @@ -23843,45 +33588,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "B", "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": "B", "range": Array [ - 12, - 20, + 6, + 7, ], "type": "Identifier", }, ], - "name": "foo", + "name": "B", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 6, }, }, ], @@ -23890,24 +33629,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-factory-static-member.src 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 72, + 57, ], "type": "Program", }, @@ -23917,7 +33660,7 @@ Object { "block": Object { "range": Array [ 0, - 72, + 57, ], "type": "Program", }, @@ -23927,7 +33670,7 @@ Object { "block": Object { "range": Array [ 0, - 72, + 56, ], "type": "ClassDeclaration", }, @@ -23936,8 +33679,8 @@ Object { "$id": 4, "block": Object { "range": Array [ - 48, - 70, + 49, + 54, ], "type": "FunctionExpression", }, @@ -23982,10 +33725,10 @@ Object { "$ref": 5, }, "identifier": Object { - "name": "configurable", + "name": "Foo", "range": Array [ - 19, - 31, + 15, + 18, ], "type": "Identifier", }, @@ -24004,7 +33747,7 @@ Object { "$ref": 6, }, "variableMap": Object { - "Point": Object { + "C": Object { "$ref": 1, }, }, @@ -24017,17 +33760,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Point", + "name": "C", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 72, + 56, ], "type": "ClassDeclaration", }, @@ -24038,15 +33781,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Point", + "name": "C", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, ], - "name": "Point", + "name": "C", "references": Array [], "scope": Object { "$ref": 5, @@ -24068,7 +33811,7 @@ Object { "$ref": 7, }, "variableMap": Object { - "Point": Object { + "C": Object { "$ref": 0, }, }, @@ -24081,17 +33824,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Point", + "name": "C", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 72, + 56, ], "type": "ClassDeclaration", }, @@ -24102,15 +33845,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Point", + "name": "C", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, ], - "name": "Point", + "name": "C", "references": Array [], "scope": Object { "$ref": 6, @@ -24137,13 +33880,13 @@ Object { } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-instance-member.src 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 82, + 50, ], "type": "Program", }, @@ -24153,7 +33896,7 @@ Object { "block": Object { "range": Array [ 0, - 82, + 50, ], "type": "Program", }, @@ -24163,7 +33906,7 @@ Object { "block": Object { "range": Array [ 0, - 82, + 49, ], "type": "ClassDeclaration", }, @@ -24172,8 +33915,8 @@ Object { "$id": 4, "block": Object { "range": Array [ - 56, - 80, + 42, + 47, ], "type": "FunctionExpression", }, @@ -24218,10 +33961,10 @@ Object { "$ref": 5, }, "identifier": Object { - "name": "foo", + "name": "onlyRead", "range": Array [ - 19, - 22, + 15, + 23, ], "type": "Identifier", }, @@ -24240,7 +33983,7 @@ Object { "$ref": 6, }, "variableMap": Object { - "Other": Object { + "A": Object { "$ref": 1, }, }, @@ -24253,17 +33996,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Other", + "name": "A", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 49, ], "type": "ClassDeclaration", }, @@ -24274,15 +34017,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Other", + "name": "A", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, ], - "name": "Other", + "name": "A", "references": Array [], "scope": Object { "$ref": 5, @@ -24304,7 +34047,7 @@ Object { "$ref": 7, }, "variableMap": Object { - "Other": Object { + "A": Object { "$ref": 0, }, }, @@ -24317,17 +34060,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Other", + "name": "A", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 49, ], "type": "ClassDeclaration", }, @@ -24338,15 +34081,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Other", + "name": "A", "range": Array [ 6, - 11, + 7, ], "type": "Identifier", }, ], - "name": "Other", + "name": "A", "references": Array [], "scope": Object { "$ref": 6, @@ -24373,13 +34116,13 @@ Object { } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-static-member.src 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 55, + 50, ], "type": "Program", }, @@ -24389,7 +34132,7 @@ Object { "block": Object { "range": Array [ 0, - 55, + 50, ], "type": "Program", }, @@ -24399,7 +34142,7 @@ Object { "block": Object { "range": Array [ 0, - 55, + 49, ], "type": "ClassDeclaration", }, @@ -24408,8 +34151,8 @@ Object { "$id": 4, "block": Object { "range": Array [ - 31, - 53, + 42, + 47, ], "type": "FunctionExpression", }, @@ -24454,10 +34197,10 @@ Object { "$ref": 5, }, "identifier": Object { - "name": "hidden", + "name": "Foo", "range": Array [ 15, - 21, + 18, ], "type": "Identifier", }, @@ -24476,7 +34219,7 @@ Object { "$ref": 6, }, "variableMap": Object { - "P": Object { + "D": Object { "$ref": 1, }, }, @@ -24489,7 +34232,7 @@ Object { "defs": Array [ Object { "name": Object { - "name": "P", + "name": "D", "range": Array [ 6, 7, @@ -24499,7 +34242,7 @@ Object { "node": Object { "range": Array [ 0, - 55, + 49, ], "type": "ClassDeclaration", }, @@ -24510,7 +34253,7 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "P", + "name": "D", "range": Array [ 6, 7, @@ -24518,7 +34261,7 @@ Object { "type": "Identifier", }, ], - "name": "P", + "name": "D", "references": Array [], "scope": Object { "$ref": 5, @@ -24540,7 +34283,7 @@ Object { "$ref": 7, }, "variableMap": Object { - "P": Object { + "D": Object { "$ref": 0, }, }, @@ -24553,7 +34296,7 @@ Object { "defs": Array [ Object { "name": Object { - "name": "P", + "name": "D", "range": Array [ 6, 7, @@ -24563,7 +34306,7 @@ Object { "node": Object { "range": Array [ 0, - 55, + 49, ], "type": "ClassDeclaration", }, @@ -24574,7 +34317,7 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "P", + "name": "D", "range": Array [ 6, 7, @@ -24582,7 +34325,7 @@ Object { "type": "Identifier", }, ], - "name": "P", + "name": "D", "references": Array [], "scope": Object { "$ref": 6, @@ -24609,43 +34352,43 @@ Object { } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-array-pattern-decorator.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, - 78, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 78, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, - 78, + 51, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ - 44, - 76, + 17, + 49, ], "type": "FunctionExpression", }, @@ -24654,69 +34397,71 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { - "name": "a", + "name": "special", "range": Array [ - 68, - 69, + 19, + 26, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 4, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { - "a": Object { - "$ref": 4, - }, "arguments": Object { + "$ref": 2, + }, + "bar": Object { "$ref": 3, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, Object { - "$id": 4, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "bar", "range": Array [ - 45, - 46, + 35, + 38, ], "type": "Identifier", }, "node": Object { "range": Array [ - 44, - 76, + 17, + 49, ], "type": "FunctionExpression", }, @@ -24727,22 +34472,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "bar", "range": Array [ - 45, - 46, + 35, + 38, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - ], + "name": "bar", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -24750,41 +34491,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "adminonly", - "range": Array [ - 18, - 27, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "class", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { - "User": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -24792,17 +34515,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "User", + "name": "Foo", "range": Array [ 6, - 10, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 78, + 51, ], "type": "ClassDeclaration", }, @@ -24813,18 +34536,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "User", + "name": "Foo", "range": Array [ 6, - 10, + 9, ], "type": "Identifier", }, ], - "name": "User", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -24835,20 +34558,20 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { - "User": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -24856,17 +34579,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "User", + "name": "Foo", "range": Array [ 6, - 10, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 78, + 51, ], "type": "ClassDeclaration", }, @@ -24877,18 +34600,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "User", + "name": "Foo", "range": Array [ 6, - 10, + 9, ], "type": "Identifier", }, ], - "name": "User", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -24899,83 +34622,262 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/class-decorators/class-decorator.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` Object { - "$id": 5, + "$id": 11, "block": Object { "range": Array [ 0, - 20, + 116, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 10, "block": Object { "range": Array [ 0, - 20, + 116, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 9, "block": Object { "range": Array [ 0, - 20, + 115, ], "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 31, + 113, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "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": 8, + }, + "identifier": Object { + "name": "APP_CONFIG", + "range": Array [ + 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": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "config": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + 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": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 10, }, "variableMap": Object { - "Qux": Object { - "$ref": 2, + "Service": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 10, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "Qux", + "name": "Service", "range": Array [ - 14, - 17, + 6, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 20, + 115, ], "type": "ClassDeclaration", }, @@ -24986,18 +34888,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Qux", + "name": "Service", "range": Array [ - 14, - 17, + 6, + 13, ], "type": "Identifier", }, ], - "name": "Qux", + "name": "Service", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 9, }, }, ], @@ -25005,41 +34907,29 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "sealed", - "range": Array [ - 1, - 7, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "$ref": 4, }, - ], - "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 5, + }, + Object { + "$ref": 6, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 11, }, "variableMap": Object { - "Qux": Object { + "Service": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 10, }, "variables": Array [ Object { @@ -25047,17 +34937,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Qux", + "name": "Service", "range": Array [ - 14, - 17, + 6, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 20, + 115, ], "type": "ClassDeclaration", }, @@ -25068,18 +34958,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Qux", + "name": "Service", "range": Array [ - 14, - 17, + 6, + 13, ], "type": "Identifier", }, ], - "name": "Qux", + "name": "Service", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 10, }, }, ], @@ -25090,83 +34980,199 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 11, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/class-decorators/class-decorator-factory.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, - 58, + 53, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, - 58, + 53, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 58, + 52, ], "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 19, + 50, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "special", + "range": Array [ + 21, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "baz": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "baz", + "range": Array [ + 35, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 50, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "baz", + "range": Array [ + 35, + 46, + ], + "type": "Identifier", + }, + ], + "name": "baz", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "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", }, @@ -25177,18 +35183,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, }, }, ], @@ -25196,41 +35202,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 { @@ -25238,17 +35226,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", }, @@ -25259,18 +35247,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, }, }, ], @@ -25281,86 +35269,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, }, }, ], @@ -25368,41 +35421,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 { @@ -25410,17 +35445,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", }, @@ -25431,18 +35466,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, }, }, ], @@ -25453,20 +35488,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 { @@ -25474,17 +35509,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", }, @@ -25495,18 +35530,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, }, }, ], @@ -25517,86 +35552,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, }, }, ], @@ -25604,41 +35727,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 { @@ -25646,17 +35751,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", }, @@ -25667,18 +35772,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, }, }, ], @@ -25689,20 +35794,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 { @@ -25710,17 +35815,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", }, @@ -25731,18 +35836,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, }, }, ], @@ -25753,86 +35858,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, }, }, ], @@ -25840,41 +36033,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 { @@ -25882,17 +36057,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", }, @@ -25903,18 +36078,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, }, }, ], @@ -25925,20 +36100,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 { @@ -25946,17 +36121,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", }, @@ -25967,18 +36142,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, }, }, ], @@ -25989,86 +36164,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": 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, }, }, ], @@ -26076,41 +36316,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 { @@ -26118,17 +36340,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", }, @@ -26139,18 +36361,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, }, }, ], @@ -26161,20 +36383,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 { @@ -26182,17 +36404,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", }, @@ -26203,18 +36425,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, }, }, ], @@ -26225,26 +36447,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", }, @@ -26254,7 +36476,7 @@ Object { "block": Object { "range": Array [ 0, - 52, + 51, ], "type": "Program", }, @@ -26264,7 +36486,7 @@ Object { "block": Object { "range": Array [ 0, - 51, + 50, ], "type": "ClassDeclaration", }, @@ -26274,7 +36496,7 @@ Object { "block": Object { "range": Array [ 17, - 49, + 48, ], "type": "FunctionExpression", }, @@ -26313,7 +36535,7 @@ Object { "arguments": Object { "$ref": 2, }, - "bar": Object { + "foo": Object { "$ref": 3, }, }, @@ -26337,17 +36559,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", }, @@ -26358,15 +36580,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, @@ -26411,7 +36633,7 @@ Object { "node": Object { "range": Array [ 0, - 51, + 50, ], "type": "ClassDeclaration", }, @@ -26475,7 +36697,7 @@ Object { "node": Object { "range": Array [ 0, - 51, + 50, ], "type": "ClassDeclaration", }, @@ -26521,208 +36743,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, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, + "name": "SomeComponent", + "references": Array [], + "scope": Object { + "$ref": 5, }, - "variableScope": Object { - "$ref": 7, + }, + ], + }, + ], + "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", }, - "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, - }, - }, + "node": Object { + "range": Array [ + 0, + 88, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "SomeComponent", + "range": Array [ + 6, + 19, ], + "type": "Identifier", }, ], + "name": "SomeComponent", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-static-member.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 93, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 93, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 93, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "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": 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 { @@ -26730,17 +37085,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", }, @@ -26751,18 +37106,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, }, }, ], @@ -26773,23 +37128,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 { @@ -26797,17 +37152,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", }, @@ -26818,18 +37173,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, }, }, ], @@ -26840,178 +37195,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 { @@ -27019,17 +37306,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", }, @@ -27040,18 +37327,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, }, }, ], @@ -27062,20 +37349,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 { @@ -27083,17 +37373,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", }, @@ -27104,18 +37394,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, }, }, ], @@ -27126,175 +37416,110 @@ 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", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 34, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "baz": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, + "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 [ - 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, - }, - }, - ], + "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, }, ], - "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 { - "StaticFoo": Object { + "C": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { @@ -27302,17 +37527,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "StaticFoo", + "name": "C", "range": Array [ 6, - 15, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 65, + 53, ], "type": "ClassDeclaration", }, @@ -27323,18 +37548,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "StaticFoo", + "name": "C", "range": Array [ 6, - 15, + 7, ], "type": "Identifier", }, ], - "name": "StaticFoo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 4, }, }, ], @@ -27345,20 +37570,23 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 6, }, "variableMap": Object { - "StaticFoo": Object { + "C": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { @@ -27366,17 +37594,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "StaticFoo", + "name": "C", "range": Array [ 6, - 15, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 65, + 53, ], "type": "ClassDeclaration", }, @@ -27387,18 +37615,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "StaticFoo", + "name": "C", "range": Array [ 6, - 15, + 7, ], "type": "Identifier", }, ], - "name": "StaticFoo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 5, }, }, ], @@ -27409,198 +37637,68 @@ 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-instance-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/class-empty-extends.src 1`] = ` Object { - "$id": 9, + "$id": 4, "block": Object { "range": Array [ 0, - 98, + 23, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 3, "block": Object { "range": Array [ 0, - 98, + 23, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 2, "block": Object { "range": Array [ 0, - 97, + 22, ], "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": 3, }, "variableMap": Object { - "Greeter": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 3, }, "variables": Array [ Object { @@ -27608,17 +37706,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Greeter", + "name": "Foo", "range": Array [ 6, - 13, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 97, + 22, ], "type": "ClassDeclaration", }, @@ -27629,18 +37727,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": 2, }, }, ], @@ -27649,22 +37747,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 9, + "$ref": 4, }, "variableMap": Object { - "Greeter": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 3, }, "variables": Array [ Object { @@ -27672,17 +37766,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Greeter", + "name": "Foo", "range": Array [ 6, - 13, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 97, + 22, ], "type": "ClassDeclaration", }, @@ -27693,18 +37787,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": 3, }, }, ], @@ -27713,218 +37807,81 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/class-empty-extends-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, + 37, ], "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, - }, - }, - ], - }, - ], + "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", }, @@ -27935,18 +37892,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, }, }, ], @@ -27954,23 +37911,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 { - "StaticGreeter": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, "variables": Array [ Object { @@ -27978,17 +37953,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", }, @@ -27999,18 +37974,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, }, }, ], @@ -28021,179 +37996,69 @@ 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-extends-empty-implements.src 1`] = ` Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 52, + 38, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 52, + 38, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 51, + 37, ], "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, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -28207,7 +38072,7 @@ Object { "node": Object { "range": Array [ 0, - 51, + 37, ], "type": "ClassDeclaration", }, @@ -28229,7 +38094,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], @@ -28237,15 +38102,33 @@ 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": 8, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -28253,7 +38136,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -28271,7 +38154,7 @@ Object { "node": Object { "range": Array [ 0, - 51, + 37, ], "type": "ClassDeclaration", }, @@ -28293,7 +38176,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], @@ -28304,193 +38187,83 @@ 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/class-multiple-implements.src 1`] = ` Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 51, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 51, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 50, + 36, ], "type": "ClassDeclaration", }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 17, - 48, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "special", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "foo": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 17, - 48, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], + "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, - 50, + 36, ], "type": "ClassDeclaration", }, @@ -28501,18 +38274,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, }, }, ], @@ -28520,23 +38293,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 { @@ -28544,17 +38335,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 50, + 36, ], "type": "ClassDeclaration", }, @@ -28565,18 +38356,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, }, }, ], @@ -28587,167 +38378,196 @@ 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/property-decorators/property-decorator-factory-instance-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/decorator-on-enum-declaration.src 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 88, + 14, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ 0, - 88, + 14, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ 0, - 88, + 14, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, "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, - }, + "references": Array [], + "throughReferences": Array [], + "type": "enum", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "E": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Output", + "name": Object { + "name": "E", "range": Array [ - 46, - 52, + 10, + 11, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "EventEmitter", + "node": Object { "range": Array [ - 71, - 83, + 0, + 14, ], - "type": "Identifier", + "type": "TSEnumDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "parent": undefined, + "type": "EnumName", }, ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 4, + "name": "E", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", }, ], - "type": "class", + "name": "E", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/decorator-on-function.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", "upperScope": Object { - "$ref": 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, }, }, ], @@ -28756,28 +38576,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 { @@ -28785,39 +38595,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, }, }, ], @@ -28826,182 +38636,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 { @@ -29009,39 +38715,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, }, }, ], @@ -29050,179 +38756,206 @@ 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", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "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 { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", + "name": Object { + "name": "a", "range": Array [ + 14, 15, - 18, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 4, + "node": Object { + "range": Array [ + 14, + 19, + ], + "type": "VariableDeclarator", }, - "identifier": Object { - "name": "bar", + "parent": Object { "range": Array [ - 27, - 30, + 0, + 19, ], - "type": "Identifier", + "type": "VariableDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "type": "Variable", }, ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 3, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", }, ], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "B": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ + "name": "a", + "references": 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, - }, + "$ref": 1, }, ], + "scope": Object { + "$ref": 2, + }, }, ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "references": Array [ Object { - "$ref": 2, + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 1, }, ], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 3, }, "variableMap": Object { - "B": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -29230,39 +38963,45 @@ Object { "defs": Array [ Object { "name": Object { - "name": "B", + "name": "foo", "range": Array [ 6, - 7, + 16, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 39, + 16, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "foo", "range": Array [ 6, - 7, + 16, ], "type": "Identifier", }, ], - "name": "B", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -29273,150 +39012,228 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 1, }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-arguments-in-call-expression.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 9, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$ref": 3, + "$id": 1, + "block": Object { + "range": Array [ + 0, + 9, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-arguments-in-new-expression.src 1`] = ` Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ 0, - 54, + 12, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ 0, - 54, + 12, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-parameters.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 53, + 18, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "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", + "references": Array [], + "throughReferences": Array [], + "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 3, }, "variableMap": Object { - "C": Object { + "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "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", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "C", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -29425,25 +39242,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 4, }, "variableMap": Object { - "C": Object { + "f1": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [ Object { @@ -29451,39 +39261,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "C", + "name": "f1", "range": Array [ - 6, - 7, + 9, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 53, + 18, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "f1", "range": Array [ - 6, - 7, + 9, + 11, ], "type": "Identifier", }, ], - "name": "C", + "name": "f1", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 3, }, }, ], @@ -29492,31 +39302,24 @@ 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": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/class-empty-extends.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-arrow-function.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 23, + 19, ], "type": "Program", }, @@ -29526,7 +39329,7 @@ Object { "block": Object { "range": Array [ 0, - 23, + 19, ], "type": "Program", }, @@ -29536,63 +39339,34 @@ Object { "block": Object { "range": Array [ 0, - 22, + 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, - 22, - ], - "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, @@ -29610,7 +39384,7 @@ Object { "$ref": 4, }, "variableMap": Object { - "Foo": Object { + "f1": Object { "$ref": 0, }, }, @@ -29623,36 +39397,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "f1", "range": Array [ - 6, 9, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 22, + 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, @@ -29675,52 +39449,93 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/class-empty-extends-implements.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-constructor.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 38, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 38, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 37, + 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 { - "Foo": Object { + "foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -29728,7 +39543,7 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "foo", "range": Array [ 6, 9, @@ -29738,7 +39553,7 @@ Object { "node": Object { "range": Array [ 0, - 37, + 34, ], "type": "ClassDeclaration", }, @@ -29749,7 +39564,7 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "foo", "range": Array [ 6, 9, @@ -29757,10 +39572,10 @@ Object { "type": "Identifier", }, ], - "name": "Foo", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -29772,15 +39587,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { - "Foo": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -29788,7 +39603,7 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "foo", "range": Array [ 6, 9, @@ -29798,7 +39613,7 @@ Object { "node": Object { "range": Array [ 0, - 37, + 34, ], "type": "ClassDeclaration", }, @@ -29809,7 +39624,7 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "foo", "range": Array [ 6, 9, @@ -29817,10 +39632,10 @@ Object { "type": "Identifier", }, ], - "name": "Foo", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -29834,19 +39649,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/class-extends-empty-implements.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-function-expression.src 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 38, + 28, ], "type": "Program", }, @@ -29856,7 +39671,7 @@ Object { "block": Object { "range": Array [ 0, - 38, + 28, ], "type": "Program", }, @@ -29865,64 +39680,35 @@ Object { "$id": 3, "block": Object { "range": Array [ - 0, - 37, + 12, + 27, ], - "type": "ClassDeclaration", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "function", "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "Foo": Object { + "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "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", - }, - ], + "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, @@ -29940,29 +39726,33 @@ Object { "$ref": 4, }, "identifier": Object { - "name": "Bar", + "name": "foo", "range": Array [ - 18, - 21, + 6, + 9, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 27, + ], + "type": "FunctionExpression", + }, }, ], + "throughReferences": Array [], "type": "module", "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "foo": Object { "$ref": 0, }, }, @@ -29975,7 +39765,7 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "foo", "range": Array [ 6, 9, @@ -29983,20 +39773,26 @@ Object { "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 37, + 27, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "foo", "range": Array [ 6, 9, @@ -30004,8 +39800,12 @@ Object { "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { "$ref": 4, }, @@ -30016,11 +39816,7 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -30031,52 +39827,93 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/class-multiple-implements.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 37, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 37, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 36, + 27, ], "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": "class", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "a": Object { + "foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -30084,17 +39921,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 36, + 27, ], "type": "ClassDeclaration", }, @@ -30105,18 +39942,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, }, }, ], @@ -30128,15 +39965,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 { @@ -30144,17 +39981,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 36, + 27, ], "type": "ClassDeclaration", }, @@ -30165,18 +40002,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, }, }, ], @@ -30190,19 +40027,19 @@ 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-method-signature.src 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 14, + 30, ], "type": "Program", }, @@ -30212,7 +40049,7 @@ Object { "block": Object { "range": Array [ 0, - 14, + 30, ], "type": "Program", }, @@ -30222,16 +40059,16 @@ Object { "block": Object { "range": Array [ 0, - 14, + 29, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "enum", + "type": "interface", "upperScope": Object { "$ref": 2, }, @@ -30251,7 +40088,7 @@ Object { "$ref": 3, }, "variableMap": Object { - "E": Object { + "foo": Object { "$ref": 0, }, }, @@ -30264,36 +40101,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "E", + "name": "foo", "range": Array [ 10, - 11, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 14, + 29, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "E", + "name": "foo", "range": Array [ 10, - 11, + 13, ], "type": "Identifier", }, ], - "name": "E", + "name": "foo", "references": Array [], "scope": Object { "$ref": 2, @@ -30316,66 +40153,50 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/decorator-on-function.src 1`] = ` +exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 20, + 72, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 20, + 72, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ - 0, - 19, + 7, + 72, ], - "type": "FunctionDeclaration", + "type": "TSEnumDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "enum", "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, @@ -30384,15 +40205,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "b": Object { + "X": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -30400,39 +40221,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "b", + "name": "X", "range": Array [ - 14, - 15, + 68, + 69, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 19, + 7, + 72, ], - "type": "FunctionDeclaration", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "FunctionName", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "b", + "name": "X", "range": Array [ - 14, - 15, + 68, + 69, ], "type": "Identifier", }, ], - "name": "b", + "name": "X", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -30446,221 +40267,114 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/decorator-on-variable.src 1`] = ` +exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 20, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 20, + 49, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": 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 { + "$id": 3, + "block": Object { "range": Array [ - 18, - 19, + 0, + 48, ], - "type": "Literal", + "type": "TSTypeAliasDeclaration", }, - }, - ], - "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 [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { "name": "a", "range": Array [ - 14, - 15, + 16, + 25, ], "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", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "name": "a", - "references": Array [ Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], + "$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 [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { "foo": Object { @@ -30668,7 +40382,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -30678,26 +40392,20 @@ Object { "name": Object { "name": "foo", "range": Array [ - 6, - 16, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 16, + 48, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -30705,8 +40413,8 @@ Object { Object { "name": "foo", "range": Array [ - 6, - 16, + 5, + 8, ], "type": "Identifier", }, @@ -30714,7 +40422,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -30723,229 +40431,188 @@ 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/errorRecovery/empty-type-arguments-in-call-expression.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 9, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 9, + 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 [ 0, - 3, + 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 {}, - "variableScope": Object { - "$ref": 1, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "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", + "variableScope": Object { + "$ref": 2, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "variables": Array [ Object { "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "Foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", + "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, }, - "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, - }, - ], + "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, @@ -30954,15 +40621,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 { @@ -30970,9 +40637,9 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f1", + "name": "d", "range": Array [ - 9, + 10, 11, ], "type": "Identifier", @@ -30980,29 +40647,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, }, }, ], @@ -31016,19 +40683,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", }, @@ -31038,7 +40705,7 @@ Object { "block": Object { "range": Array [ 0, - 19, + 51, ], "type": "Program", }, @@ -31048,52 +40715,62 @@ Object { "block": Object { "range": Array [ 0, - 18, + 49, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ + "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, }, }, @@ -31106,36 +40783,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, @@ -31147,7 +40824,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -31158,153 +40839,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, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 25, - 32, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 4, + "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": "baz", + "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": 6, + "$ref": 4, }, "variableMap": Object { - "foo": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [ Object { @@ -31312,39 +40933,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, }, }, ], @@ -31353,120 +40974,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 { @@ -31474,49 +41083,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, }, }, ], @@ -31525,164 +41124,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 { + "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, - 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, - }, - }, - ], + "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 { @@ -31690,39 +41233,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, }, }, ], @@ -31731,109 +41274,235 @@ 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-method-signature.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 30, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 30, + 51, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "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, + }, + ], + "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, + 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": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$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-method-export.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 72, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 72, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ - 7, - 72, + 0, + 50, ], - "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": "bar", + "range": Array [ + 29, + 40, + ], + "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 [], }, @@ -31841,18 +41510,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 { @@ -31860,39 +41533,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, + 50, ], - "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, }, }, ], @@ -31901,420 +41574,324 @@ 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 [ + "throughReferences": 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 [], + "$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-export.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, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 52, - ], - "type": "Program", + "$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, + 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 [], - "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 [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 54, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$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-public.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 [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "Program", - }, - "childScopes": Array [ + "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-method-export.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -32324,7 +41901,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32332,170 +41909,566 @@ 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-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-protected.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 53, + 41, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, - 53, + 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-public.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 52, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 52, + 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, @@ -32506,46 +42479,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, @@ -32556,46 +42599,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, @@ -32606,46 +42719,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, @@ -32656,46 +42839,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, @@ -32706,46 +42959,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, @@ -32756,44 +43079,74 @@ 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/object-assertion-not-allowed.src 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 41, + 12, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, - 41, + 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 [], }, @@ -32801,49 +43154,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-static.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 [], }, @@ -32851,24 +43236,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-property-with-default-value.src 1`] = ` +exports[`typescript fixtures/errorRecovery/solo-const.src 1`] = ` Object { "$id": 1, "block": Object { "range": Array [ 0, - 39, + 5, ], "type": "Program", }, @@ -32878,7 +43267,7 @@ Object { "block": Object { "range": Array [ 0, - 39, + 5, ], "type": "Program", }, @@ -32912,25 +43301,23 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/interface-with-no-body.src 1`] = `"'{' expected."`; - -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", }, @@ -32941,39 +43328,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 [], }, @@ -32985,34 +43406,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", }, @@ -33021,43 +43448,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, @@ -33065,76 +43586,29 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/errorRecovery/solo-const.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 5, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 5, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/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", }, @@ -33144,7 +43618,7 @@ Object { "block": Object { "range": Array [ 0, - 24, + 14, ], "type": "Program", }, @@ -33175,10 +43649,10 @@ Object { "$ref": 2, }, "identifier": Object { - "name": "foo", + "name": "bar", "range": Array [ - 10, - 13, + 4, + 7, ], "type": "Identifier", }, @@ -33227,89 +43701,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, + 57, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 30, + 56, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "fs": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "fs", + "range": Array [ + 41, + 43, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 41, + 43, + ], + "type": "ImportDefaultSpecifier", + }, + "parent": Object { + "range": Array [ + 34, + 54, + ], + "type": "ImportDeclaration", + }, + "type": "ImportBinding", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "fs", + "range": Array [ + 41, + 43, + ], + "type": "Identifier", + }, + ], + "name": "fs", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` +Object { + "$id": 7, "block": Object { "range": Array [ 0, - 21, + 84, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 21, + 84, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "a", + "$id": 5, + "block": Object { "range": Array [ - 6, - 7, + 21, + 84, ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "type": "TSModuleBlock", }, - "writeExpr": Object { - "range": Array [ - 10, - 20, - ], - "type": "NewExpression", + "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 { @@ -33317,49 +44040,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, }, }, ], @@ -33370,26 +44083,26 @@ 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/tagged-template-expression-type-arguments.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/global-module-declaration.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 14, + 92, ], "type": "Program", }, @@ -33399,40 +44112,18 @@ Object { "block": Object { "range": Array [ 0, - 14, + 92, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { @@ -33440,71 +44131,369 @@ Object { }, "variables": Array [], }, + Object { + "$id": 2, + "block": Object { + "range": Array [ + 43, + 51, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { + "range": Array [ + 81, + 89, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - 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 { @@ -33512,45 +44501,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, }, }, ], @@ -33562,11 +44585,11 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [], }, @@ -33579,168 +44602,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", - "references": Array [], - "scope": Object { - "$ref": 3, - }, + "name": "Id", + "references": Array [], + "scope": Object { + "$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, }, }, ], @@ -33752,15 +45069,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 { @@ -33768,17 +45088,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", }, @@ -33789,18 +45109,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, }, }, ], @@ -33814,29 +45184,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", }, @@ -33847,59 +45217,11 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { "$ref": 1, }, - "variables": Array [], - }, - Object { - "$id": 2, - "block": Object { - "range": Array [ - 43, - 51, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 81, - 89, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 0, }, "variables": Array [], }, @@ -33910,366 +45232,408 @@ Object { "throughReferences": Array [], "type": "global", "upperScope": null, - "variableMap": Object { - "global": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 1, }, - "variables": Array [ + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/array-type.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 2, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", - }, - "node": Object { + "$id": 1, + "block": Object { "range": Array [ - 21, - 51, + 0, + 19, ], - "type": "TSModuleDeclaration", + "type": "TSTypeAliasDeclaration", }, - "parent": null, - "type": "NamespaceName", - }, - Object { - "name": Object { - "name": "global", - "range": Array [ - 74, - 80, - ], - "type": "Identifier", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "upperScope": Object { + "$ref": 2, }, - "node": Object { - "range": Array [ - 56, - 89, - ], - "type": "TSModuleDeclaration", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, }, - "parent": null, - "type": "NamespaceName", + "variables": Array [], }, ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ Object { - "name": "global", - "range": Array [ - 74, - 80, + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, }, ], - "name": "global", - "references": Array [], - "scope": Object { - "$ref": 4, - }, }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` +exports[`typescript fixtures/types/conditional.src 1`] = ` Object { - "$id": 10, + "$id": 2, "block": Object { "range": Array [ 0, - 114, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 1, "block": Object { "range": Array [ 0, - 114, + 49, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 8, - "block": Object { - "range": Array [ - 13, - 112, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 5, - "block": Object { + "name": Object { + "name": "x", "range": Array [ - 34, - 73, + 4, + 47, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 58, - 66, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, + "node": Object { + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 47, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/conditional-infer.src 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, }, - "variableMap": Object { - "C": Object { - "$ref": 2, - }, + "identifier": Object { + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 9, + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 73, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "writeExpr": undefined, }, Object { - "$id": 7, - "block": Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", "range": Array [ - 93, - 110, + 35, + 36, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, + "identifier": Object { + "name": "U", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 7, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], + "identifier": Object { + "name": "T", + "range": Array [ + 46, + 47, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", + "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, }, }, ], @@ -34278,412 +45642,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, }, - "variableMap": Object { - "Point": Object { - "$ref": 5, - }, + "identifier": Object { + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 13, + "kind": "r", + "resolved": Object { + "$ref": 1, }, - "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, - }, - }, - ], + "writeExpr": undefined, }, Object { - "$id": 11, - "block": Object { + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 156, - 229, + 69, + 70, ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 12, + "type": "Identifier", }, - "variableMap": Object {}, - "variableScope": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { "$ref": 13, }, - "variables": Array [], + "identifier": Object { + "name": "U", + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 4, + "$id": 8, "from": Object { - "$ref": 12, + "$ref": 13, }, "identifier": Object { - "name": "x", + "name": "T", "range": Array [ - 27, - 28, + 83, + 84, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { "$ref": 1, }, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "Promise", "range": Array [ - 31, - 44, + 93, + 100, ], - "type": "Literal", + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 107, + 108, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 124, + 125, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 3, + }, Object { "$ref": 4, }, + 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, }, }, ], @@ -34692,21 +46052,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 { @@ -34714,89 +46093,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, }, }, ], @@ -34805,153 +46134,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 { @@ -34959,45 +46375,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, }, }, ], @@ -35006,162 +46416,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 [], } @@ -35270,7 +46540,7 @@ Object { exports[`typescript fixtures/types/constructor.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -35280,7 +46550,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35291,11 +46561,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 { @@ -35303,7 +46615,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -35349,7 +46661,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -35358,12 +46670,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 [], } @@ -35371,7 +46690,7 @@ Object { exports[`typescript fixtures/types/constructor-generic.src 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, @@ -35381,7 +46700,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -35392,19 +46711,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 { @@ -35450,7 +46832,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, }, }, ], @@ -35459,12 +46888,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 [], } @@ -35472,7 +46905,7 @@ Object { exports[`typescript fixtures/types/constructor-in-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35482,7 +46915,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35493,11 +46926,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 { @@ -35505,7 +46960,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -35551,7 +47006,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -35560,12 +47015,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 [], } @@ -35573,7 +47032,7 @@ Object { exports[`typescript fixtures/types/constructor-with-rest.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35583,7 +47042,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35594,11 +47053,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 { @@ -35606,7 +47087,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -35652,7 +47133,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -35661,12 +47142,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 [], } @@ -35674,7 +47159,7 @@ Object { exports[`typescript fixtures/types/function.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -35684,7 +47169,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35695,11 +47180,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 { @@ -35707,7 +47234,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -35753,7 +47280,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -35762,12 +47289,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 [], } @@ -35775,7 +47309,7 @@ Object { exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, @@ -35785,7 +47319,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -35796,19 +47330,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 { @@ -35854,7 +47451,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, }, }, ], @@ -35863,12 +47507,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 [], } @@ -35876,7 +47524,7 @@ Object { exports[`typescript fixtures/types/function-in-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35886,7 +47534,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35897,11 +47545,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 { @@ -35909,7 +47579,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -35955,7 +47625,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -35964,12 +47634,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 [], } @@ -35977,7 +47651,7 @@ Object { exports[`typescript fixtures/types/function-with-array-destruction.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -35987,7 +47661,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35995,31 +47669,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 [], } @@ -36027,7 +47801,7 @@ Object { exports[`typescript fixtures/types/function-with-object-destruction.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36037,7 +47811,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36045,31 +47819,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 [], } @@ -36077,7 +47951,7 @@ Object { exports[`typescript fixtures/types/function-with-rest.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36087,7 +47961,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36098,11 +47972,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 { @@ -36110,7 +48006,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -36156,7 +48052,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -36165,12 +48061,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 [], } @@ -36178,7 +48078,7 @@ Object { exports[`typescript fixtures/types/function-with-this.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36188,7 +48088,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36199,11 +48099,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 { @@ -36211,7 +48133,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -36257,7 +48179,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -36266,12 +48188,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 [], } @@ -36279,7 +48205,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36289,7 +48215,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36297,31 +48223,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 [], } @@ -36329,7 +48355,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36339,7 +48365,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36347,31 +48373,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 [], } @@ -36379,7 +48505,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36389,7 +48515,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36397,31 +48523,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 [], } @@ -36429,7 +48655,7 @@ Object { exports[`typescript fixtures/types/indexed.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36439,7 +48665,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36450,11 +48676,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 { @@ -36462,7 +48730,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -36508,7 +48776,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -36517,12 +48785,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 [], } @@ -36530,7 +48805,7 @@ Object { exports[`typescript fixtures/types/intersection-type.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -36540,7 +48815,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -36548,20 +48823,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, @@ -36572,7 +49035,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -36883,7 +49346,7 @@ Object { exports[`typescript fixtures/types/mapped.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36893,7 +49356,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36904,11 +49367,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 { @@ -36916,7 +49401,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -36962,7 +49447,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -36971,12 +49456,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 [], } @@ -36984,7 +49473,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36994,7 +49483,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37005,11 +49494,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 { @@ -37017,7 +49528,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37063,7 +49574,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37072,12 +49583,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 [], } @@ -37085,7 +49600,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly-minus.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37095,7 +49610,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37106,11 +49621,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 { @@ -37118,7 +49655,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37164,7 +49701,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37173,12 +49710,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 [], } @@ -37186,7 +49727,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly-plus.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37196,7 +49737,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37207,11 +49748,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 { @@ -37219,7 +49782,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37265,7 +49828,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37274,12 +49837,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 [], } @@ -37287,7 +49854,7 @@ Object { exports[`typescript fixtures/types/nested-types.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37297,7 +49864,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37305,20 +49872,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, @@ -37329,7 +49966,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -37337,7 +49974,7 @@ Object { exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37347,7 +49984,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37355,20 +49992,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, @@ -37379,7 +50086,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -37387,7 +50094,7 @@ Object { exports[`typescript fixtures/types/reference.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37397,7 +50104,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37408,11 +50115,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 { @@ -37420,7 +50149,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37466,7 +50195,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37475,12 +50204,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 [], } @@ -37488,7 +50221,7 @@ Object { exports[`typescript fixtures/types/reference-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37498,7 +50231,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37509,11 +50242,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 { @@ -37521,7 +50276,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37567,7 +50322,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37576,12 +50331,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 [], } @@ -37589,7 +50348,7 @@ Object { exports[`typescript fixtures/types/reference-generic-nested.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -37599,7 +50358,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37610,11 +50369,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 { @@ -37622,7 +50423,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -37668,7 +50469,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -37677,12 +50478,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 [], } @@ -37896,7 +50704,7 @@ Object { exports[`typescript fixtures/types/this-type-expanded.src 1`] = ` Object { - "$id": 24, + "$id": 28, "block": Object { "range": Array [ 0, @@ -37906,7 +50714,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 23, + "$id": 27, "block": Object { "range": Array [ 0, @@ -37916,7 +50724,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 22, + "$id": 26, "block": Object { "range": Array [ 0, @@ -37941,7 +50749,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { @@ -37966,7 +50774,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 109, @@ -37977,11 +50785,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 { @@ -37989,7 +50821,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -38000,13 +50832,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], }, Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 167, @@ -38016,7 +50848,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 203, @@ -38031,11 +50863,11 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], }, @@ -38044,9 +50876,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "fn", @@ -38058,7 +50890,7 @@ Object { }, "kind": "w", "resolved": Object { - "$ref": 7, + "$ref": 8, }, "writeExpr": Object { "range": Array [ @@ -38069,9 +50901,9 @@ Object { }, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "fn", @@ -38083,7 +50915,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 7, + "$ref": 8, }, "writeExpr": undefined, }, @@ -38091,33 +50923,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 { @@ -38159,20 +50991,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, @@ -38182,7 +51014,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 18, "block": Object { "range": Array [ 288, @@ -38197,11 +51029,11 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 17, + "$ref": 19, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 18, }, "variables": Array [], }, @@ -38210,9 +51042,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", @@ -38224,7 +51075,7 @@ Object { }, "kind": "w", "resolved": Object { - "$ref": 13, + "$ref": 14, }, "writeExpr": Object { "range": Array [ @@ -38235,9 +51086,9 @@ Object { }, }, Object { - "$id": 15, + "$id": 17, "from": Object { - "$ref": 17, + "$ref": 19, }, "identifier": Object { "name": "fn", @@ -38249,41 +51100,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 { @@ -38325,20 +51180,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, @@ -38349,36 +51204,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, @@ -38389,30 +51268,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, }, }, ], @@ -38424,7 +51327,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 23, + "$ref": 27, }, "variableMap": Object { "A": Object { @@ -38432,7 +51335,7 @@ Object { }, }, "variableScope": Object { - "$ref": 23, + "$ref": 27, }, "variables": Array [ Object { @@ -38470,9 +51373,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, }, }, ], @@ -38484,7 +51400,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 24, + "$ref": 28, }, "variableMap": Object { "A": Object { @@ -38492,7 +51408,7 @@ Object { }, }, "variableScope": Object { - "$ref": 23, + "$ref": 27, }, "variables": Array [ Object { @@ -38532,7 +51448,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 23, + "$ref": 27, }, }, ], @@ -38546,7 +51462,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 24, + "$ref": 28, }, "variables": Array [], } @@ -38699,21 +51615,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", }, @@ -38726,7 +51743,7 @@ Object { "name": "x", "range": Array [ 4, - 9, + 44, ], "type": "Identifier", }, @@ -38754,13 +51771,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", }, @@ -38770,7 +51787,7 @@ Object { "block": Object { "range": Array [ 0, - 45, + 29, ], "type": "Program", }, @@ -38800,21 +51817,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", }, @@ -38827,7 +51844,7 @@ Object { "name": "x", "range": Array [ 4, - 44, + 28, ], "type": "Identifier", }, @@ -38855,9 +51872,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, @@ -38867,7 +51884,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -38875,22 +51892,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 { @@ -38898,45 +51940,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, }, }, ], @@ -38950,57 +51986,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 [], } @@ -39109,7 +52095,7 @@ Object { exports[`typescript fixtures/types/type-operator.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -39119,7 +52105,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39130,11 +52116,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 { @@ -39145,7 +52153,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -39191,7 +52199,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, Object { @@ -39237,7 +52245,7 @@ Object { "name": "y", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -39246,12 +52254,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 [], } @@ -39634,7 +52646,7 @@ Object { exports[`typescript fixtures/types/union-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39644,7 +52656,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -39652,20 +52664,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, @@ -39676,7 +52758,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } diff --git a/packages/parser/typings/eslint-scope.d.ts b/packages/parser/typings/eslint-scope.d.ts index 2e8c4a40084f..6c231dd5d2bd 100644 --- a/packages/parser/typings/eslint-scope.d.ts +++ b/packages/parser/typings/eslint-scope.d.ts @@ -41,6 +41,8 @@ declare module 'eslint-scope/lib/variable' { references: Reference[]; defs: Definition[]; eslintUsed?: boolean; + stack?: any; + tainted?: boolean; } } @@ -49,7 +51,7 @@ declare module 'eslint-scope/lib/definition' { export class Definition { type: string; - name: TSESTree.BindingName; + name: TSESTree.Node; node: TSESTree.Node; parent?: TSESTree.Node | null; index?: number | null; @@ -58,7 +60,7 @@ declare module 'eslint-scope/lib/definition' { constructor( type: string, - name: TSESTree.BindingName | TSESTree.PropertyName, + name: TSESTree.Node, node: TSESTree.Node, parent?: TSESTree.Node | null, index?: number | null, @@ -90,6 +92,8 @@ declare module 'eslint-scope/lib/pattern-visitor' { protected scopeManager: ScopeManager; protected parent?: TSESTree.Node; public rightHandNodes: TSESTree.Node[]; + public assignments: TSESTree.Node[]; + public restElements: TSESTree.Node[]; static isPattern(node: TSESTree.Node): boolean; @@ -148,7 +152,12 @@ declare module 'eslint-scope/lib/referencer' { ): 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, @@ -211,7 +220,9 @@ declare module 'eslint-scope/lib/scope' { | 'with' | 'TDZ' | 'enum' - | 'empty-function'; + | 'empty-function' + | 'interface' + | 'type-alias'; export class Scope { type: ScopeType; @@ -225,7 +236,9 @@ declare module 'eslint-scope/lib/scope' { references: Reference[]; through: Reference[]; thisFound?: boolean; + taints: Map; functionExpressionScope: boolean; + __left: Reference[]; constructor( scopeManager: ScopeManager, @@ -241,8 +254,8 @@ declare module 'eslint-scope/lib/scope' { __dynamicCloseRef(ref: any): void; __globalCloseRef(ref: any): void; __close(scopeManager: ScopeManager): Scope; - __isValidResolution(ref: any, variable: any): boolean; - __resolve(ref: any): boolean; + __isValidResolution(ref: any, variable: any): variable is Variable; + __resolve(ref: Reference): boolean; __delegateToUpperScope(ref: any): void; __addDeclaredVariablesOfNode(variable: any, node: TSESTree.Node): void; __defineGeneric( @@ -257,11 +270,11 @@ declare module 'eslint-scope/lib/scope' { __referencing( node: TSESTree.Node, - assign: number, - writeExpr: TSESTree.Node, - maybeImplicitGlobal: any, - partial: any, - init: any + assign?: number, + writeExpr?: TSESTree.Node, + maybeImplicitGlobal?: any, + partial?: any, + init?: any ): void; __detectEval(): void; @@ -382,12 +395,29 @@ declare module 'eslint-scope/lib/reference' { import { Scope } from 'eslint-scope/lib/scope'; import Variable from 'eslint-scope/lib/variable'; + export type ReferenceFlag = 0x1 | 0x2 | 0x3; + export default class Reference { identifier: TSESTree.Identifier; from: Scope; resolved: Variable | null; writeExpr: TSESTree.Node | null; init: boolean; + partial: boolean; + protected __maybeImplicitGlobal: boolean; + tainted?: boolean; + + typeMode?: boolean; + + constructor( + identifier: TSESTree.Identifier, + scope: Scope, + flag?: ReferenceFlag, + writeExpr?: TSESTree.Node | null, + maybeImplicitGlobal?: boolean, + partial?: boolean, + init?: boolean + ); isWrite(): boolean; isRead(): boolean; @@ -417,8 +447,11 @@ declare module 'eslint-scope/lib/scope-manager' { } export default class ScopeManager { - __options: ScopeManagerOptions; + protected __options: ScopeManagerOptions; __currentScope: Scope; + protected __nodeToScope: WeakMap; + protected __declaredVariables: WeakMap; + scopes: Scope[]; globalScope: Scope; @@ -433,7 +466,7 @@ declare module 'eslint-scope/lib/scope-manager' { isStrictModeSupported(): boolean; // Returns appropriate scope for this node. - __get(node: TSESTree.Node): Scope; + __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; From fe3367963598eb51117da7ddcc05d7dec5530a3d 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 | 40 +- packages/parser/src/analyze-scope.ts | 18 +- .../lib/__snapshots__/typescript.ts.snap | 662 +++++------------- 3 files changed, 211 insertions(+), 509 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 7e811be479d4..3ca54579def3 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,14 +60,48 @@ 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 } `, // https://github.com/typescript-eslint/typescript-eslint/issues/18 ` function eachr(subject: Map): typeof subject; + `, + // 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: [] + invalid: [ + { + 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 a1ca9adc8034..1c6c02606a4b 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -482,7 +482,23 @@ class Referencer extends OriginalReferencer { * @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 17710915ef46..d31981c178a3 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -20670,7 +20670,7 @@ Object { exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 23, + "$id": 21, "block": Object { "range": Array [ 0, @@ -20680,7 +20680,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 22, + "$id": 20, "block": Object { "range": Array [ 0, @@ -20690,7 +20690,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 21, + "$id": 19, "block": Object { "range": Array [ 0, @@ -20705,7 +20705,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "bax", @@ -20722,7 +20722,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "baz", @@ -20739,41 +20739,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 21, - }, - "identifier": Object { - "name": "eee", - "range": Array [ - 95, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 21, - }, - "identifier": Object { - "name": "fff", - "range": Array [ - 122, - 134, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -20788,9 +20754,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 6, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -20805,9 +20771,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 7, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -20822,9 +20788,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 8, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "loo", @@ -20839,9 +20805,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 9, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -20856,9 +20822,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 10, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -20873,9 +20839,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 11, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -20890,9 +20856,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 12, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -20907,9 +20873,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 13, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -20924,9 +20890,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 16, + "$id": 14, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -20941,9 +20907,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 15, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -20958,9 +20924,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 18, + "$id": 16, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -20975,9 +20941,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 19, + "$id": 17, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -20992,9 +20958,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 20, + "$id": 18, "from": Object { - "$ref": 21, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -21058,16 +21024,10 @@ Object { Object { "$ref": 18, }, - Object { - "$ref": 19, - }, - Object { - "$ref": 20, - }, ], "type": "interface", "upperScope": Object { - "$ref": 22, + "$ref": 20, }, "variableMap": Object { "F": Object { @@ -21078,7 +21038,7 @@ Object { }, }, "variableScope": Object { - "$ref": 22, + "$ref": 20, }, "variables": Array [ Object { @@ -21118,7 +21078,7 @@ Object { "name": "J", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 19, }, }, Object { @@ -21158,7 +21118,7 @@ Object { "name": "F", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 19, }, }, ], @@ -21216,16 +21176,10 @@ Object { Object { "$ref": 18, }, - Object { - "$ref": 19, - }, - Object { - "$ref": 20, - }, ], "type": "module", "upperScope": Object { - "$ref": 23, + "$ref": 21, }, "variableMap": Object { "Foo": Object { @@ -21233,7 +21187,7 @@ Object { }, }, "variableScope": Object { - "$ref": 22, + "$ref": 20, }, "variables": Array [ Object { @@ -21273,7 +21227,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 22, + "$ref": 20, }, }, ], @@ -21331,18 +21285,12 @@ Object { Object { "$ref": 18, }, - Object { - "$ref": 19, - }, - Object { - "$ref": 20, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 23, + "$ref": 21, }, "variables": Array [], } @@ -40275,7 +40223,7 @@ Object { exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -40285,7 +40233,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40295,7 +40243,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40306,57 +40254,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 [], }, @@ -40364,17 +40270,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 { @@ -40382,7 +40281,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { @@ -40422,7 +40321,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -40431,19 +40330,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 [], } @@ -40691,7 +40583,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -40701,7 +40593,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40711,7 +40603,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40722,37 +40614,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 [], }, @@ -40760,14 +40630,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 { @@ -40775,7 +40641,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -40815,7 +40681,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -40824,16 +40690,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 [], } @@ -40841,7 +40703,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -40851,7 +40713,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40861,7 +40723,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40872,37 +40734,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 [], }, @@ -40910,14 +40750,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 { @@ -40925,7 +40761,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -40965,7 +40801,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -40974,16 +40810,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 [], } @@ -40991,7 +40823,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41001,7 +40833,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41011,7 +40843,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41022,37 +40854,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 [], }, @@ -41060,14 +40870,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 { @@ -41075,7 +40881,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -41115,7 +40921,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -41124,16 +40930,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 [], } @@ -41141,7 +40943,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41151,7 +40953,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41161,7 +40963,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41172,37 +40974,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 [], }, @@ -41210,14 +40990,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 { @@ -41225,7 +41001,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -41265,7 +41041,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -41274,16 +41050,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 [], } @@ -41291,7 +41063,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41301,7 +41073,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41311,7 +41083,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41322,37 +41094,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 [], }, @@ -41360,14 +41110,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 { @@ -41375,7 +41121,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -41415,7 +41161,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -41424,16 +41170,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 [], } @@ -48205,7 +47947,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48215,7 +47957,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48225,7 +47967,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48236,37 +47978,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 [], }, @@ -48274,14 +47994,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 { @@ -48289,7 +48005,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -48329,7 +48045,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -48338,16 +48054,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 [], } @@ -48355,7 +48067,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48365,7 +48077,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48375,7 +48087,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48386,37 +48098,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 [], }, @@ -48424,14 +48114,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 { @@ -48439,7 +48125,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -48479,7 +48165,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -48488,16 +48174,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 [], } @@ -48505,7 +48187,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48515,7 +48197,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48525,7 +48207,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48536,37 +48218,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 [], }, @@ -48574,14 +48234,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 { @@ -48589,7 +48245,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { @@ -48629,7 +48285,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -48638,16 +48294,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 430965375c4a90466cce256dfb74861609342cf6 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 8ec32a8bfcd6..e3d207ed1f87 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 f07ee4ae7ddc819fd6ba69d9e4848a746bc1914b 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 --- packages/eslint-plugin/tests/RuleTester.ts | 10 +++++++--- .../tests/eslint-rules/no-undef.test.ts | 12 ++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index 3a7a01b8fd79..0188f921bebc 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -4,6 +4,11 @@ import { RuleTester as ESLintRuleTester } from 'eslint'; import * as path from 'path'; import RuleModule from 'ts-eslint'; +interface EnvTestOptions { + browser?: boolean; + es6?: boolean; +} + interface ValidTestCase> { code: string; options?: TOptions; @@ -12,9 +17,7 @@ interface ValidTestCase> { settings?: Record; parser?: string; globals?: Record; - env?: { - browser?: boolean; - }; + env?: EnvTestOptions; } interface InvalidTestCase< @@ -53,6 +56,7 @@ declare class RuleTesterTyped { const RuleTester = (ESLintRuleTester as any) as { new (config?: { parser: '@typescript-eslint/parser'; + env?: EnvTestOptions; parserOptions?: ParserOptions; }): RuleTesterTyped; }; 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 3ca54579def3..185c65a4f611 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -4,9 +4,9 @@ import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 10, - sourceType: 'module', - ecmaFeatures: {} + sourceType: 'module' }, + 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 From 73813edd55aa2f506537e4ae3fc29e7eb9d44636 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 --- packages/parser/src/analyze-scope.ts | 114 +- packages/parser/src/scope/pattern-visitor.ts | 85 + packages/parser/src/scope/scope-manager.ts | 80 +- packages/parser/src/scope/scopes.ts | 159 +- .../lib/__snapshots__/scope-analysis.ts.snap | 6048 +++------ .../tests/lib/__snapshots__/tsx.ts.snap | 115 +- .../lib/__snapshots__/typescript.ts.snap | 11098 ++++------------ packages/parser/typings/eslint-scope.d.ts | 52 +- 8 files changed, 4564 insertions(+), 13187 deletions(-) create mode 100644 packages/parser/src/scope/pattern-visitor.ts diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 1c6c02606a4b..e494b317f682 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -1,4 +1,3 @@ -import OriginalPatternVisitor from 'eslint-scope/lib/pattern-visitor'; import Reference from 'eslint-scope/lib/reference'; import OriginalReferencer from 'eslint-scope/lib/referencer'; import { getKeys as fallback } from 'eslint-visitor-keys'; @@ -17,104 +16,10 @@ import { } from './scope/definition'; import { typeReferencing } from './scope/reference'; import { ScopeManager } from './scope/scope-manager'; +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: any) { - return /* @this {Scope} */ function(this: any, node: any, definition: any) { - define.call(this, 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; - } - }; -} - -class PatternVisitor extends OriginalPatternVisitor { - constructor( - options: PatternVisitorOptions, - rootPattern: any, - callback: PatternVisitorCallback - ) { - super(options, rootPattern, callback); - } - - static isPattern(node: TSESTree.Node) { - const nodeType = node.type; - - return ( - OriginalPatternVisitor.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 OriginalReferencer { +class Referencer extends OriginalReferencer { protected typeMode: boolean; constructor(options: any, scopeManager: ScopeManager) { @@ -449,7 +354,7 @@ class Referencer extends OriginalReferencer { this.visit(node.typeParameters); if (node.id) { - scope.__define( + scope.__defineType( node.id, new TypeDefinition('InterfaceName', node.id, node, null, null, null) ); @@ -554,7 +459,7 @@ class Referencer extends OriginalReferencer { node.params[i], { processRightHandNodes: true }, (pattern, info) => { - this.currentScope().__define( + this.currentScope().__defineType( pattern, new TypeDefinition('TypeParameter', pattern, node, null, i) ); @@ -790,7 +695,7 @@ class Referencer extends OriginalReferencer { this.typeMode = true; if (node.id && node.id.type === 'Identifier') { - scope.__define( + scope.__defineType( node.id, new Definition('TypeAliasName', node.id, node, null, null, 'type') ); @@ -853,11 +758,7 @@ class Referencer extends OriginalReferencer { 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 === 'TSModuleBlock') { @@ -865,7 +766,6 @@ class Referencer extends OriginalReferencer { } 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..b48d5f9b6853 --- /dev/null +++ b/packages/parser/src/scope/pattern-visitor.ts @@ -0,0 +1,85 @@ +import OriginalPatternVisitor from 'eslint-scope/lib/pattern-visitor'; +import { + PatternVisitorCallback, + PatternVisitorOptions +} from 'eslint-scope/lib/options'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; + +export class PatternVisitor extends OriginalPatternVisitor { + constructor( + options: PatternVisitorOptions, + rootPattern: any, + callback: PatternVisitorCallback + ) { + super(options, rootPattern, callback); + } + + static isPattern(node: TSESTree.Node) { + const nodeType = node.type; + + return ( + OriginalPatternVisitor.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 dc205d46dce4..78f842fcf932 100644 --- a/packages/parser/src/scope/scope-manager.ts +++ b/packages/parser/src/scope/scope-manager.ts @@ -4,17 +4,27 @@ import EslintScopeManager, { ScopeManagerOptions } from 'eslint-scope/lib/scope-manager'; import { + Scope, EmptyFunctionScope, EnumScope, InterfaceScope, - TypeAliasScope + TypeAliasScope, + GlobalScope, + ModuleScope, + FunctionExpressionNameScope, + SwitchScope, + CatchScope, + WithScope, + BlockScope, + ForScope, + FunctionScope, + ClassScope } from './scopes'; -import { Scope } from 'eslint-scope/lib/scope'; /** * based on eslint-scope */ -export class ScopeManager extends EslintScopeManager { +export class ScopeManager extends EslintScopeManager { scopes!: Scope[]; globalScope!: Scope; @@ -23,30 +33,84 @@ export class ScopeManager extends EslintScopeManager { } /** @internal */ - __nestEnumScope(node: TSESTree.TSEnumDeclaration) { + __nestEnumScope(node: TSESTree.TSEnumDeclaration): Scope { return this.__nestScope(new EnumScope(this, this.__currentScope, node)); } /** @internal */ - __nestEmptyFunctionScope(node: TSESTree.TSDeclareFunction) { + __nestEmptyFunctionScope(node: TSESTree.TSDeclareFunction): Scope { return this.__nestScope( new EmptyFunctionScope(this, this.__currentScope, node) ); } /** @internal */ - __nestInterfaceScope(node: TSESTree.TSInterfaceDeclaration) { + __nestInterfaceScope(node: TSESTree.TSInterfaceDeclaration): Scope { return this.__nestScope( new InterfaceScope(this, this.__currentScope, node) ); } /** @internal */ - __nestTypeAliasScope(node: TSESTree.TSTypeAliasDeclaration) { + __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 ed4a85e1167f..0062ac30bd75 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -1,31 +1,24 @@ -import { Scope as EslintScope } from 'eslint-scope/lib/scope'; -import { TSESTree } from '@typescript-eslint/typescript-estree'; +import * as esScope from 'eslint-scope/lib/scope'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import { ScopeManager } from './scope-manager'; import { Reference } from 'eslint-scope'; +import { Definition } from 'eslint-scope/lib/definition'; +import Variable from 'eslint-scope/lib/variable'; -export class Scope extends EslintScope { - /** @internal */ - __resolve(ref: Reference): boolean { - const name = ref.identifier.name; +export class Scope extends esScope.Scope { + setTypes: Map = new Map(); + types: 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: Definition) { + 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: Reference): boolean { + return super.__resolve(ref); } } @@ -71,4 +64,124 @@ export class TypeAliasScope extends Scope { } } -// TODO: extend all Scopes +/// eslint scopes + +export class GlobalScope extends esScope.GlobalScope { + setTypes: Map = new Map(); + types: Variable[] = []; + + /** @internal */ + __defineType(node: TSESTree.Node, def: Definition) { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + } + } + + __define(node: TSESTree.Identifier, definition: Definition) { + 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 esScope.FunctionExpressionNameScope { + setTypes: Map = new Map(); + types: Variable[] = []; + + /** @internal */ + __defineType(node: TSESTree.Node, def: Definition) { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + } + } +} + +export class WithScope extends esScope.WithScope { + setTypes: Map = new Map(); + types: Variable[] = []; + + /** @internal */ + __defineType(node: TSESTree.Node, def: Definition) { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.types, node, def); + } + } +} + +export class FunctionScope extends esScope.FunctionScope { + setTypes: Map = new Map(); + types: Variable[] = []; + + /** @internal */ + __defineType(node: TSESTree.Node, def: Definition) { + 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 e3d207ed1f87..8de1f8f788e7 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 384bedec44cc..aa251ddd0164 100644 --- a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap @@ -52,7 +52,7 @@ Object { exports[`TSX fixtures/react-typed-props.src 1`] = ` Object { - "$id": 10, + "$id": 9, "block": Object { "range": Array [ 0, @@ -62,7 +62,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -72,7 +72,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 31, @@ -87,16 +87,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, @@ -109,9 +109,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Props", @@ -122,15 +122,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", @@ -142,45 +140,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 { @@ -216,11 +214,11 @@ Object { "name": "props", "references": Array [ Object { - "$ref": 7, + "$ref": 6, }, ], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -229,16 +227,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 { @@ -246,7 +245,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [ Object { @@ -292,55 +291,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 { @@ -376,7 +331,7 @@ Object { "name": "App", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 8, }, }, ], @@ -385,12 +340,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 d31981c178a3..15b211efa56f 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 [], } @@ -1245,7 +1159,7 @@ Object { exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -1255,7 +1169,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -1265,7 +1179,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 7, @@ -1280,11 +1194,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -1295,58 +1209,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, @@ -1357,7 +1226,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -1509,7 +1378,7 @@ Object { exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -1519,7 +1388,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1529,7 +1398,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -1542,9 +1411,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "X", @@ -1555,15 +1424,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", @@ -1574,15 +1441,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", @@ -1594,77 +1459,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 { @@ -1700,11 +1522,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -1713,14 +1535,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 [], }, @@ -1728,12 +1557,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 [], } @@ -2273,7 +2109,7 @@ Object { exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -2283,7 +2119,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -2293,7 +2129,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -2306,9 +2142,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -2323,9 +2159,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -2342,19 +2178,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 [], }, @@ -2364,66 +2200,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, @@ -2431,17 +2222,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 [], } @@ -2449,7 +2240,7 @@ Object { exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -2459,7 +2250,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -2469,7 +2260,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -2482,9 +2273,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 4, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -2499,9 +2290,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -2518,242 +2309,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, @@ -2764,11 +2339,11 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], }, @@ -2788,19 +2363,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", }, @@ -2810,7 +2385,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", }, @@ -4390,7 +4064,7 @@ Object { exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, @@ -4400,7 +4074,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, @@ -4410,7 +4084,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -4420,7 +4094,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 23, @@ -4435,18 +4109,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 { @@ -4457,53 +4128,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, @@ -4518,69 +4149,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, }, }, ], @@ -4592,7 +4180,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { "C": Object { @@ -4600,7 +4188,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -4640,7 +4228,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 6, }, }, ], @@ -4652,7 +4240,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object { "C": Object { @@ -4660,7 +4248,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -4700,7 +4288,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -4714,7 +4302,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } @@ -5350,7 +4938,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5360,7 +4948,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5370,7 +4958,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5385,19 +4973,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 { @@ -5433,7 +5021,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -5443,9 +5031,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "B", @@ -5460,9 +5048,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "Bar", @@ -5479,70 +5067,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 { @@ -5578,7 +5123,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -5589,17 +5134,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 [], } @@ -5607,7 +5152,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5617,7 +5162,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5627,7 +5172,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5642,19 +5187,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 { @@ -5690,7 +5235,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -5700,9 +5245,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "B", @@ -5717,9 +5262,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "C", @@ -5734,9 +5279,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "D", @@ -5751,9 +5296,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 7, }, "identifier": Object { "name": "Bar", @@ -5769,6 +5314,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -5778,68 +5326,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 { @@ -5875,7 +5377,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -5885,6 +5387,9 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 1, + }, Object { "$ref": 2, }, @@ -5894,15 +5399,12 @@ Object { Object { "$ref": 4, }, - Object { - "$ref": 5, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 8, }, "variables": Array [], } @@ -5910,7 +5412,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5920,7 +5422,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5930,7 +5432,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5940,7 +5442,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 20, @@ -5955,18 +5457,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 { @@ -5977,47 +5476,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, }, }, ], @@ -6029,7 +5488,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -6037,7 +5496,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -6077,7 +5536,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -6089,7 +5548,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -6097,7 +5556,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { @@ -6137,7 +5596,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -6151,7 +5610,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [], } @@ -6159,7 +5618,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6169,7 +5628,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -6179,7 +5638,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -6189,7 +5648,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 20, @@ -6202,9 +5661,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Bar", @@ -6221,23 +5680,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 { @@ -6248,47 +5704,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, }, }, ], @@ -6299,12 +5715,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -6312,7 +5728,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -6352,7 +5768,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -6363,12 +5779,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6376,7 +5792,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -6416,7 +5832,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -6427,14 +5843,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 [], } @@ -7298,7 +6714,7 @@ Object { exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { - "$id": 11, + "$id": 10, "block": Object { "range": Array [ 0, @@ -7308,7 +6724,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 9, "block": Object { "range": Array [ 0, @@ -7318,7 +6734,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -7343,7 +6759,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 8, }, "variableMap": Object { "arguments": Object { @@ -7368,7 +6784,7 @@ Object { ], }, Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 35, @@ -7383,18 +6799,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 { @@ -7405,53 +6818,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, @@ -7466,26 +6839,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, }, }, ], @@ -7497,7 +6870,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 10, + "$ref": 9, }, "variableMap": Object { "C": Object { @@ -7505,7 +6878,7 @@ Object { }, }, "variableScope": Object { - "$ref": 10, + "$ref": 9, }, "variables": Array [ Object { @@ -7545,7 +6918,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 8, }, }, ], @@ -7557,7 +6930,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 11, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -7565,7 +6938,7 @@ Object { }, }, "variableScope": Object { - "$ref": 10, + "$ref": 9, }, "variables": Array [ Object { @@ -7605,7 +6978,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, ], @@ -7619,7 +6992,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 10, }, "variables": Array [], } @@ -7627,7 +7000,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 26, + "$id": 22, "block": Object { "range": Array [ 0, @@ -7637,7 +7010,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 25, + "$id": 21, "block": Object { "range": Array [ 0, @@ -7647,7 +7020,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 15, + "$id": 12, "block": Object { "range": Array [ 0, @@ -7657,7 +7030,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 11, "block": Object { "range": Array [ 60, @@ -7672,11 +7045,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 15, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 12, }, "variables": Array [], }, @@ -7685,9 +7058,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 11, + "$id": 8, "from": Object { - "$ref": 15, + "$ref": 12, }, "identifier": Object { "name": "Constructor", @@ -7698,15 +7071,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", @@ -7717,15 +7088,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", @@ -7737,92 +7106,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 { @@ -7858,17 +7183,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, @@ -7883,19 +7208,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 { @@ -7931,13 +7256,13 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 14, }, }, ], }, Object { - "$id": 19, + "$id": 16, "block": Object { "range": Array [ 130, @@ -7952,19 +7277,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 { @@ -8000,13 +7325,13 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 16, }, }, ], }, Object { - "$id": 20, + "$id": 17, "block": Object { "range": Array [ 142, @@ -8021,16 +7346,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, @@ -8043,9 +7368,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 22, + "$id": 18, "from": Object { - "$ref": 24, + "$ref": 20, }, "identifier": Object { "name": "args", @@ -8060,9 +7385,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 23, + "$id": 19, "from": Object { - "$ref": 24, + "$ref": 20, }, "identifier": Object { "name": "T", @@ -8073,84 +7398,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", @@ -8161,15 +7438,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", @@ -8186,9 +7461,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 25, + "$ref": 21, }, "identifier": Object { "name": "C", @@ -8207,23 +7482,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, }, @@ -8232,7 +7513,7 @@ Object { }, }, "variableScope": Object { - "$ref": 25, + "$ref": 21, }, "variables": Array [ Object { @@ -8272,11 +7553,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 6, + "$ref": 4, }, ], "scope": Object { - "$ref": 25, + "$ref": 21, }, }, Object { @@ -8316,7 +7597,7 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 25, + "$ref": 21, }, }, Object { @@ -8354,101 +7635,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, }, }, ], @@ -8459,14 +7652,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 [], } @@ -8474,7 +7679,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -8484,7 +7689,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -8494,7 +7699,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -8507,9 +7712,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "Constructor", @@ -8524,9 +7729,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "M", @@ -8543,9 +7748,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -8556,13 +7761,14 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 3, + }, Object { "$ref": 4, }, @@ -8572,13 +7778,10 @@ Object { ], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Base": Object { - "$ref": 3, - }, - "T": Object { "$ref": 2, }, "arguments": Object { @@ -8586,7 +7789,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -8597,55 +7800,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 { @@ -8681,7 +7840,7 @@ Object { "name": "Base", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -8692,12 +7851,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 { @@ -8705,7 +7867,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -8745,11 +7907,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 5, + "$ref": 4, }, ], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -8760,14 +7922,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 [], } @@ -11985,7 +11150,7 @@ Object { exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, @@ -11995,7 +11160,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, @@ -12005,7 +11170,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -12015,7 +11180,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 25, @@ -12030,18 +11195,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 { @@ -12052,53 +11214,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, @@ -12113,69 +11235,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, }, }, ], @@ -12187,7 +11266,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 7, }, "variableMap": Object { "A": Object { @@ -12195,7 +11274,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -12235,7 +11314,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 6, }, }, ], @@ -12247,7 +11326,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object { "A": Object { @@ -12255,7 +11334,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -12295,7 +11374,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -12309,7 +11388,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } @@ -12317,7 +11396,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12327,7 +11406,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -12337,7 +11416,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -12352,19 +11431,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 { @@ -12400,7 +11479,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -12412,62 +11491,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 { @@ -12503,7 +11539,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -12517,7 +11553,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -12525,7 +11561,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12535,7 +11571,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12545,7 +11581,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -12560,19 +11596,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 { @@ -12608,7 +11644,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -12618,9 +11654,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Bar", @@ -12637,67 +11673,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 { @@ -12733,7 +11726,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -12744,14 +11737,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 [], } @@ -12759,7 +11752,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -12769,7 +11762,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -12779,7 +11772,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -12794,19 +11787,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 { @@ -12842,7 +11835,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -12854,62 +11847,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 { @@ -12945,7 +11895,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -12959,7 +11909,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -15449,7 +14399,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15459,7 +14409,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -15469,7 +14419,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 15, @@ -15484,11 +14434,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -15499,58 +14449,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, @@ -15561,7 +14466,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -15569,7 +14474,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15579,7 +14484,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, @@ -15589,7 +14494,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ 15, @@ -15604,11 +14509,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [], }, @@ -15619,101 +14524,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, @@ -15724,7 +14541,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } @@ -15732,7 +14549,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -15742,7 +14559,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15752,7 +14569,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 7, @@ -15767,19 +14584,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 { @@ -15815,7 +14632,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -15827,62 +14644,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 { @@ -15918,7 +14692,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -15932,7 +14706,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -15940,7 +14714,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -15950,7 +14724,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15960,7 +14734,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 7, @@ -15975,19 +14749,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 { @@ -16023,7 +14797,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -16035,105 +14809,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 { @@ -16169,7 +14857,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 3, }, }, ], @@ -16183,7 +14871,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, "variables": Array [], } @@ -16429,7 +15117,7 @@ Object { exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16439,7 +15127,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -16449,7 +15137,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 7, @@ -16464,11 +15152,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -16479,58 +15167,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, @@ -16541,7 +15184,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -16549,7 +15192,7 @@ Object { exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16559,7 +15202,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -16569,7 +15212,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 7, @@ -16584,11 +15227,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -16599,58 +15242,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, @@ -16661,7 +15259,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -16669,7 +15267,7 @@ Object { exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -16679,7 +15277,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -16689,7 +15287,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 7, @@ -16702,9 +15300,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "a", @@ -16721,16 +15319,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 [], }, @@ -16740,63 +15338,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, @@ -16804,14 +15357,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 [], } @@ -16819,7 +15372,7 @@ Object { exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16829,7 +15382,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -16839,7 +15392,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 10, @@ -16852,9 +15405,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { "name": "a", @@ -16866,7 +15419,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 4, + "$ref": 3, }, "writeExpr": undefined, }, @@ -16874,21 +15427,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 { @@ -16899,51 +15449,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 { @@ -16979,11 +15489,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 5, + "$ref": 4, }, ], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -16995,7 +15505,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "obj", @@ -17021,7 +15531,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "obj": Object { @@ -17029,7 +15539,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -17079,7 +15589,7 @@ Object { }, ], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -17093,7 +15603,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } @@ -18261,7 +16771,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -18271,7 +16781,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -18281,7 +16791,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -18294,9 +16804,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "X", @@ -18307,15 +16817,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", @@ -18326,15 +16834,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", @@ -18346,29 +16852,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 { @@ -18379,58 +16889,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 { @@ -18466,11 +16929,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 6, + "$ref": 5, }, ], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -18479,10 +16942,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 { @@ -18490,7 +16960,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -18530,7 +17000,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -18539,12 +17009,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 [], } @@ -18552,7 +17029,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, @@ -18562,7 +17039,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -18572,7 +17049,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -18587,18 +17064,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 { @@ -18609,47 +17083,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, }, }, ], @@ -18661,7 +17095,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { "compare": Object { @@ -18669,7 +17103,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -18709,7 +17143,7 @@ Object { "name": "compare", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -18723,7 +17157,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } @@ -18731,7 +17165,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` Object { - "$id": 9, + "$id": 8, "block": Object { "range": Array [ 0, @@ -18741,7 +17175,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -18751,7 +17185,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -18764,9 +17198,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 6, }, "identifier": Object { "name": "X", @@ -18777,15 +17211,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", @@ -18796,15 +17228,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", @@ -18816,29 +17246,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 { @@ -18849,58 +17283,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 { @@ -18936,11 +17323,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 6, + "$ref": 5, }, ], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -18949,10 +17336,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 { @@ -18960,7 +17354,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -19000,7 +17394,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], @@ -19009,12 +17403,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 [], } @@ -19762,7 +18163,7 @@ Object { exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -19772,7 +18173,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19782,7 +18183,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ 0, @@ -19797,16 +18198,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, @@ -19819,9 +18220,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "X", @@ -19836,9 +18237,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "Y", @@ -19853,225 +18254,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, @@ -20106,56 +18288,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, @@ -20179,7 +18316,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 { @@ -20207,22 +18344,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", }, @@ -20232,11 +18386,14 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, ], - "type": "interface", + "type": "type-alias", "upperScope": Object { "$ref": 3, }, @@ -20251,6 +18408,9 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, @@ -20259,56 +18419,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, @@ -20316,14 +18539,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 [], } @@ -20331,7 +18554,7 @@ Object { exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -20341,7 +18564,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -20351,7 +18574,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -20364,9 +18587,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "Bar", @@ -20381,9 +18604,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "Baz", @@ -20400,19 +18623,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 [], }, @@ -20422,66 +18645,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, @@ -20489,17 +18667,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 [], } @@ -20507,7 +18685,7 @@ Object { exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -20517,7 +18695,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, @@ -20527,7 +18705,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ 0, @@ -20542,11 +18720,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [], }, @@ -20557,101 +18735,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, @@ -20662,7 +18752,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } @@ -20670,7 +18760,7 @@ Object { exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 21, + "$id": 18, "block": Object { "range": Array [ 0, @@ -20680,7 +18770,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 20, + "$id": 17, "block": Object { "range": Array [ 0, @@ -20690,7 +18780,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 19, + "$id": 16, "block": Object { "range": Array [ 0, @@ -20703,9 +18793,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 0, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "bax", @@ -20720,9 +18810,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "baz", @@ -20737,9 +18827,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 2, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -20754,9 +18844,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 3, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -20771,9 +18861,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 4, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "c", @@ -20788,9 +18878,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 5, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "loo", @@ -20805,9 +18895,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 6, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -20822,9 +18912,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 7, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -20839,9 +18929,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 8, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "c", @@ -20856,9 +18946,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 9, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -20873,9 +18963,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 10, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -20890,9 +18980,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 11, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "c", @@ -20907,9 +18997,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 12, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -20924,9 +19014,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 16, + "$id": 13, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -20941,9 +19031,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 14, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "a", @@ -20958,9 +19048,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 18, + "$id": 15, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "b", @@ -20976,6 +19066,15 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, @@ -21015,119 +19114,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 [ - 222, - 223, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 221, - 224, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "J", - "range": Array [ - 222, - 223, - ], - "type": "Identifier", - }, - ], - "name": "J", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "F", - "range": Array [ - 275, - 276, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 274, - 277, - ], - "type": "TSTypeParameterDeclaration", - }, - "parent": null, - "type": "TypeParameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "F", - "range": Array [ - 275, - 276, - ], - "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, }, @@ -21167,76 +19178,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, - 295, - ], - "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, }, @@ -21276,21 +19242,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 [], } @@ -21298,7 +19255,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, @@ -21308,7 +19265,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21318,7 +19275,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -21331,9 +19288,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "x", @@ -21348,9 +19305,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "y", @@ -21367,19 +19324,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 [], }, @@ -21389,66 +19346,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, @@ -21456,17 +19368,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 [], } @@ -21474,7 +19386,7 @@ Object { exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21484,7 +19396,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -21494,7 +19406,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -21507,9 +19419,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -21526,16 +19438,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 [], }, @@ -21545,63 +19457,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, @@ -21609,14 +19476,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 [], } @@ -21624,7 +19491,7 @@ Object { exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -21634,7 +19501,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21644,7 +19511,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -21657,9 +19524,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 4, + "$ref": 2, }, "identifier": Object { "name": "Bar", @@ -21674,9 +19541,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 2, }, "identifier": Object { "name": "J", @@ -21693,19 +19560,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 [], }, @@ -21715,109 +19582,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, @@ -21825,17 +19604,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 [], } @@ -21843,7 +19622,7 @@ Object { exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, @@ -21853,7 +19632,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, @@ -21863,7 +19642,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ 0, @@ -21878,11 +19657,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 3, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [], }, @@ -21893,101 +19672,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, @@ -21998,7 +19689,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } @@ -22006,7 +19697,7 @@ Object { exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22016,7 +19707,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22026,7 +19717,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -22039,9 +19730,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -22058,16 +19749,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 [], }, @@ -22077,63 +19768,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, @@ -22141,14 +19787,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 [], } @@ -22156,7 +19802,7 @@ Object { exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -22166,7 +19812,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -22176,7 +19822,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22189,9 +19835,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "bar", @@ -22206,9 +19852,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "bar", @@ -22223,9 +19869,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -22236,15 +19882,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", @@ -22255,13 +19899,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, }, @@ -22271,71 +19919,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, }, @@ -22345,64 +19947,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, }, @@ -22414,7 +19977,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 6, }, "variables": Array [], } @@ -22422,7 +19985,7 @@ Object { exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -22432,7 +19995,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22442,7 +20005,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22455,9 +20018,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { "name": "foo", @@ -22472,9 +20035,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { "name": "bar", @@ -22489,9 +20052,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 3, }, "identifier": Object { "name": "baz", @@ -22508,22 +20071,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 [], }, @@ -22533,69 +20096,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, @@ -22603,20 +20121,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 [], } @@ -22624,7 +20142,7 @@ Object { exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22634,7 +20152,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -22644,7 +20162,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -22659,11 +20177,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -22674,58 +20192,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, @@ -22736,7 +20209,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -22744,7 +20217,7 @@ Object { exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22754,7 +20227,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22764,7 +20237,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -22777,9 +20250,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "foo", @@ -22796,16 +20269,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 [], }, @@ -22815,63 +20288,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, @@ -22879,14 +20307,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 [], } @@ -23930,7 +21358,7 @@ Object { exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { - "$id": 14, + "$id": 12, "block": Object { "range": Array [ 0, @@ -23940,7 +21368,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 11, "block": Object { "range": Array [ 0, @@ -23950,7 +21378,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 29, @@ -23965,18 +21393,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 { @@ -23987,53 +21412,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, @@ -24048,75 +21433,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, @@ -24131,32 +21473,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, @@ -24171,33 +21513,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 { @@ -24233,7 +21575,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 10, }, }, ], @@ -24245,7 +21587,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "foo", @@ -24271,7 +21613,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 14, + "$ref": 12, }, "variableMap": Object { "foo": Object { @@ -24279,7 +21621,7 @@ Object { }, }, "variableScope": Object { - "$ref": 13, + "$ref": 11, }, "variables": Array [ Object { @@ -24329,7 +21671,7 @@ Object { }, ], "scope": Object { - "$ref": 13, + "$ref": 11, }, }, ], @@ -24343,7 +21685,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 12, }, "variables": Array [], } @@ -24610,7 +21952,7 @@ Object { exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -24620,7 +21962,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -24630,7 +21972,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24643,9 +21985,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "Success", @@ -24660,9 +22002,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -24673,15 +22015,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", @@ -24698,70 +22038,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, @@ -24769,66 +22063,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, @@ -24836,17 +22088,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 [], } @@ -24854,7 +22109,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, @@ -24864,7 +22119,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -24874,7 +22129,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24887,9 +22142,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "Success", @@ -24904,9 +22159,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -24917,15 +22172,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", @@ -24942,70 +22195,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, @@ -25013,66 +22220,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, @@ -25080,17 +22245,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 [], } @@ -25098,7 +22266,7 @@ Object { exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25108,7 +22276,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25118,7 +22286,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -25133,11 +22301,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -25148,58 +22316,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, @@ -25210,7 +22333,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -26046,7 +23169,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-interface.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -26056,7 +23179,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -26066,7 +23189,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -26079,9 +23202,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "node", @@ -26096,9 +23219,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "node", @@ -26115,19 +23238,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 [], }, @@ -26137,66 +23260,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, @@ -26204,17 +23282,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 [], } @@ -26507,7 +23585,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` Object { - "$id": 12, + "$id": 10, "block": Object { "range": Array [ 0, @@ -26517,7 +23595,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 9, "block": Object { "range": Array [ 0, @@ -26527,7 +23605,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 44, @@ -26542,18 +23620,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 { @@ -26564,53 +23639,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, @@ -26623,9 +23658,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 9, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 8, }, "identifier": Object { "name": "Foo", @@ -26642,74 +23677,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, }, }, ], @@ -26721,7 +23713,7 @@ Object { Object { "$id": 2, "from": Object { - "$ref": 11, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -26738,7 +23730,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 11, + "$ref": 9, }, "identifier": Object { "name": "foo", @@ -26761,12 +23753,12 @@ Object { "$ref": 3, }, Object { - "$ref": 9, + "$ref": 7, }, ], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 10, }, "variableMap": Object { "bar": Object { @@ -26777,7 +23769,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 9, }, "variables": Array [ Object { @@ -26817,7 +23809,7 @@ Object { "name": "bar", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 9, }, }, Object { @@ -26857,7 +23849,7 @@ Object { "name": "baz", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 9, }, }, ], @@ -26874,14 +23866,14 @@ Object { "$ref": 3, }, Object { - "$ref": 9, + "$ref": 7, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 10, }, "variables": Array [], } @@ -26889,7 +23881,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 20, + "$id": 17, "block": Object { "range": Array [ 0, @@ -26899,7 +23891,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 19, + "$id": 16, "block": Object { "range": Array [ 0, @@ -26909,7 +23901,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 7, "block": Object { "range": Array [ 0, @@ -26924,19 +23916,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 { @@ -26972,13 +23964,13 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 7, }, }, ], }, Object { - "$id": 12, + "$id": 9, "block": Object { "range": Array [ 75, @@ -26993,19 +23985,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 { @@ -27041,13 +24033,13 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 9, }, }, ], }, Object { - "$id": 15, + "$id": 12, "block": Object { "range": Array [ 165, @@ -27060,9 +24052,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 13, + "$id": 10, "from": Object { - "$ref": 15, + "$ref": 12, }, "identifier": Object { "name": "bar2", @@ -27073,15 +24065,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", @@ -27092,32 +24082,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, @@ -27130,9 +24118,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 16, + "$id": 13, "from": Object { - "$ref": 18, + "$ref": 15, }, "identifier": Object { "name": "bar", @@ -27143,15 +24131,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", @@ -27162,27 +24148,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 [], }, @@ -27191,9 +24175,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 2, "from": Object { - "$ref": 19, + "$ref": 16, }, "identifier": Object { "name": "A", @@ -27204,15 +24188,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", @@ -27223,15 +24205,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", @@ -27242,15 +24222,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", @@ -27261,174 +24239,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 { @@ -27464,11 +24322,11 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 16, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -27504,101 +24362,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, }, }, ], @@ -27607,12 +24371,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 [], } @@ -27815,7 +24604,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -27825,7 +24614,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -27835,7 +24624,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -27850,11 +24639,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -27865,58 +24654,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, @@ -27927,7 +24671,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -27935,7 +24679,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -27945,7 +24689,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -27955,7 +24699,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -27970,11 +24714,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -27985,58 +24729,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, @@ -28047,7 +24746,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -28055,7 +24754,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28065,7 +24764,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28075,7 +24774,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -28090,11 +24789,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -28105,58 +24804,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, @@ -28167,7 +24821,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -28175,7 +24829,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28185,7 +24839,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28195,7 +24849,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -28210,11 +24864,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -28225,58 +24879,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, @@ -28287,7 +24896,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -28295,7 +24904,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28305,7 +24914,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28315,7 +24924,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -28330,11 +24939,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -28345,58 +24954,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, @@ -28407,7 +24971,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -28415,7 +24979,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28425,7 +24989,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28435,7 +24999,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -28450,11 +25014,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -28465,58 +25029,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, @@ -28527,7 +25046,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -28535,7 +25054,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28545,7 +25064,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28555,7 +25074,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -28570,11 +25089,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -28585,58 +25104,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, @@ -28647,7 +25121,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -28655,7 +25129,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28665,7 +25139,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28675,7 +25149,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -28690,11 +25164,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -28705,58 +25179,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, @@ -28767,7 +25196,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -28775,7 +25204,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28785,7 +25214,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28795,7 +25224,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -28810,11 +25239,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -28825,58 +25254,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, @@ -28887,7 +25271,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -28895,7 +25279,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -28905,7 +25289,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -28915,7 +25299,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -28930,11 +25314,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -28945,58 +25329,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, @@ -29007,7 +25346,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -29015,7 +25354,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29025,7 +25364,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -29035,7 +25374,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -29050,11 +25389,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -29065,58 +25404,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, @@ -29127,7 +25421,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -29135,7 +25429,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29145,7 +25439,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -29155,7 +25449,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -29170,11 +25464,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -29185,58 +25479,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, @@ -29247,7 +25496,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -29255,7 +25504,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29265,7 +25514,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -29275,7 +25524,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -29290,11 +25539,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -29305,58 +25554,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, @@ -29367,7 +25571,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -29375,7 +25579,7 @@ Object { exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -29385,7 +25589,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -29395,7 +25599,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -29408,9 +25612,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "bar", @@ -29425,9 +25629,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "bar", @@ -29442,9 +25646,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -29455,15 +25659,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", @@ -29474,13 +25676,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, }, @@ -29490,71 +25696,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, }, @@ -29564,64 +25724,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, }, @@ -29633,7 +25754,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 6, }, "variables": Array [], } @@ -29641,7 +25762,7 @@ Object { exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -29651,7 +25772,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -29661,7 +25782,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -29674,9 +25795,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "onclick", @@ -29691,9 +25812,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "this", @@ -29708,9 +25829,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "e", @@ -29725,9 +25846,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Event", @@ -29743,6 +25864,9 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, @@ -29752,17 +25876,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 [], }, @@ -29771,6 +25892,9 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ + Object { + "$ref": 0, + }, Object { "$ref": 1, }, @@ -29780,70 +25904,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, }, @@ -29853,15 +25932,12 @@ Object { Object { "$ref": 3, }, - Object { - "$ref": 4, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [], } @@ -29869,7 +25945,7 @@ Object { exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -29879,7 +25955,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -29889,7 +25965,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -29904,11 +25980,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -29919,58 +25995,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, @@ -29981,7 +26012,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -31384,7 +27415,7 @@ Object { exports[`typescript fixtures/declare/interface.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -31394,7 +27425,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -31404,7 +27435,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -31419,11 +27450,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -31434,58 +27465,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 [ - 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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -31496,7 +27482,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -31742,126 +27728,81 @@ Object { } `; -exports[`typescript fixtures/declare/type-alias.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 26, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 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": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 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, - "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": 2, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 25, + ], + "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 [], +} +`; + exports[`typescript fixtures/declare/variable.src 1`] = ` Object { "$id": 2, @@ -38597,7 +34538,7 @@ Object { exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -38607,7 +34548,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -38617,7 +34558,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -38632,11 +34573,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -38647,58 +34588,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "M": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, - "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, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -38709,7 +34605,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -39983,7 +35879,7 @@ Object { exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -39993,7 +35889,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40003,7 +35899,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -40018,11 +35914,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -40033,58 +35929,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, @@ -40095,7 +35946,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -40223,7 +36074,7 @@ Object { exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40233,7 +36084,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40243,7 +36094,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -40258,11 +36109,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -40273,58 +36124,13 @@ Object { "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, - 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, - }, - }, - ], + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -40335,7 +36141,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -40343,7 +36149,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40353,7 +36159,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40363,7 +36169,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -40378,11 +36184,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -40393,58 +36199,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, @@ -40455,7 +36216,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -40463,7 +36224,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40473,7 +36234,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40483,7 +36244,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -40498,11 +36259,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -40513,58 +36274,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, @@ -40575,7 +36291,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -40583,7 +36299,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40593,7 +36309,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40603,7 +36319,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -40618,11 +36334,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -40633,58 +36349,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, @@ -40695,7 +36366,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -40703,7 +36374,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40713,7 +36384,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40723,7 +36394,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -40738,11 +36409,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -40753,58 +36424,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, @@ -40815,7 +36441,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -40823,7 +36449,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40833,7 +36459,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40843,7 +36469,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -40858,11 +36484,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -40873,58 +36499,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, @@ -40935,7 +36516,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -40943,7 +36524,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -40953,7 +36534,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -40963,7 +36544,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -40978,11 +36559,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -40993,58 +36574,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, @@ -41055,7 +36591,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -41063,7 +36599,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41073,7 +36609,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41083,7 +36619,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -41098,11 +36634,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -41113,58 +36649,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, @@ -41175,7 +36666,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -41183,7 +36674,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41193,7 +36684,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41203,7 +36694,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41216,9 +36707,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -41235,16 +36726,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 [], }, @@ -41254,63 +36745,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, @@ -41318,14 +36764,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 [], } @@ -41333,7 +36779,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41343,7 +36789,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41353,7 +36799,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41366,9 +36812,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -41385,16 +36831,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 [], }, @@ -41404,63 +36850,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, @@ -41468,14 +36869,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 [], } @@ -41483,7 +36884,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-protected.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41493,7 +36894,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41503,7 +36904,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41516,9 +36917,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -41535,16 +36936,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 [], }, @@ -41554,63 +36955,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, @@ -41618,14 +36974,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 [], } @@ -41633,7 +36989,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41643,7 +36999,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41653,7 +37009,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41666,9 +37022,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -41685,16 +37041,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 [], }, @@ -41704,63 +37060,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, @@ -41768,14 +37079,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 [], } @@ -41783,7 +37094,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41793,7 +37104,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41803,7 +37114,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -41816,9 +37127,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "bar", @@ -41835,16 +37146,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 [], }, @@ -41854,63 +37165,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, @@ -41918,14 +37184,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 [], } @@ -41933,7 +37199,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -41943,7 +37209,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41953,7 +37219,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41966,9 +37232,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -41983,9 +37249,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { "name": "baz", @@ -42002,19 +37268,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 [], }, @@ -42024,66 +37290,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, @@ -42091,17 +37312,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 [], } @@ -42109,7 +37330,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42119,7 +37340,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42129,7 +37350,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -42144,11 +37365,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -42159,58 +37380,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, @@ -42221,7 +37397,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -42229,7 +37405,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42239,7 +37415,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42249,7 +37425,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -42262,75 +37438,30 @@ Object { "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, - 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, + "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, @@ -42341,7 +37472,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -42349,7 +37480,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42359,7 +37490,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42369,7 +37500,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -42384,11 +37515,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -42399,58 +37530,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, - 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, @@ -42461,7 +37547,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -42469,7 +37555,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42479,7 +37565,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42489,7 +37575,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -42504,11 +37590,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -42519,58 +37605,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, @@ -42581,7 +37622,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -42589,7 +37630,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-static.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42599,7 +37640,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42609,7 +37650,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -42624,11 +37665,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -42639,58 +37680,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, @@ -42701,7 +37697,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -42709,7 +37705,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-with-default-value.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42719,7 +37715,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42729,7 +37725,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -42744,11 +37740,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -42759,58 +37755,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, @@ -42821,7 +37772,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -44352,7 +39303,7 @@ Object { exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` Object { - "$id": 16, + "$id": 15, "block": Object { "range": Array [ 0, @@ -44362,7 +39313,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 15, + "$id": 14, "block": Object { "range": Array [ 0, @@ -44372,7 +39323,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 13, "block": Object { "range": Array [ 9, @@ -44524,7 +39475,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 14, + "$ref": 13, }, "variableMap": Object { "Point": Object { @@ -44532,7 +39483,7 @@ Object { }, }, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [ Object { @@ -44578,7 +39529,7 @@ Object { ], }, Object { - "$id": 13, + "$id": 12, "block": Object { "range": Array [ 156, @@ -44588,7 +39539,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 11, "block": Object { "range": Array [ 173, @@ -44603,11 +39554,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 13, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [], }, @@ -44618,58 +39569,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, @@ -44678,7 +39584,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 14, + "$ref": 13, }, "identifier": Object { "name": "x", @@ -44708,7 +39614,7 @@ Object { ], "type": "block", "upperScope": Object { - "$ref": 15, + "$ref": 14, }, "variableMap": Object { "B": Object { @@ -44719,7 +39625,7 @@ Object { }, }, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [ Object { @@ -44759,7 +39665,7 @@ Object { "name": "Point", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, Object { @@ -44799,7 +39705,7 @@ Object { "name": "B", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, ], @@ -44811,7 +39717,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 16, + "$ref": 15, }, "variableMap": Object { "A": Object { @@ -44822,7 +39728,7 @@ Object { }, }, "variableScope": Object { - "$ref": 15, + "$ref": 14, }, "variables": Array [ Object { @@ -44862,7 +39768,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 15, + "$ref": 14, }, }, Object { @@ -44912,7 +39818,7 @@ Object { }, ], "scope": Object { - "$ref": 15, + "$ref": 14, }, }, ], @@ -44926,7 +39832,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 15, }, "variables": Array [], } @@ -44984,7 +39890,7 @@ Object { exports[`typescript fixtures/types/array-type.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -44994,7 +39900,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -45004,7 +39910,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -45019,11 +39925,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -45034,58 +39940,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, @@ -45096,7 +39957,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -45205,7 +40066,7 @@ Object { exports[`typescript fixtures/types/conditional-infer.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -45215,7 +40076,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -45225,7 +40086,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -45238,9 +40099,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -45251,15 +40112,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", @@ -45274,9 +40133,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "U", @@ -45286,99 +40145,51 @@ Object { ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "T", - "range": Array [ - 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, - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 46, + 47, + ], + "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, @@ -45386,66 +40197,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, @@ -45453,17 +40225,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 [], } @@ -45471,7 +40249,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` Object { - "$id": 15, + "$id": 13, "block": Object { "range": Array [ 0, @@ -45481,7 +40259,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 12, "block": Object { "range": Array [ 0, @@ -45491,7 +40269,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 11, "block": Object { "range": Array [ 0, @@ -45504,9 +40282,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -45517,15 +40295,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", @@ -45540,9 +40316,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -45557,9 +40333,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -45570,15 +40346,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", @@ -45593,9 +40367,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -45610,9 +40384,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 6, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -45623,15 +40397,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", @@ -45646,9 +40418,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 8, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -45663,9 +40435,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 9, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "U", @@ -45680,9 +40452,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 10, "from": Object { - "$ref": 13, + "$ref": 11, }, "identifier": Object { "name": "T", @@ -45693,19 +40465,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, }, @@ -45713,94 +40495,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, }, @@ -45808,81 +40544,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, }, @@ -45890,20 +40593,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 [], } @@ -45911,7 +40614,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` Object { - "$id": 8, + "$id": 6, "block": Object { "range": Array [ 0, @@ -45921,7 +40624,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -45931,7 +40634,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -45944,9 +40647,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -45957,15 +40660,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", @@ -45980,9 +40681,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 2, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "U", @@ -45997,9 +40698,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 4, }, "identifier": Object { "name": "U", @@ -46016,73 +40717,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, @@ -46090,69 +40745,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, @@ -46160,20 +40773,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 [], } @@ -46432,7 +41048,7 @@ Object { exports[`typescript fixtures/types/constructor-generic.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -46442,7 +41058,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -46455,9 +41071,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "a", @@ -46472,9 +41088,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -46485,15 +41101,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", @@ -46504,31 +41118,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 { @@ -46574,54 +41189,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, }, }, ], @@ -46631,15 +41199,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 [], } @@ -47051,7 +41625,7 @@ Object { exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, @@ -47061,7 +41635,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, @@ -47074,9 +41648,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "a", @@ -47091,9 +41665,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "T", @@ -47104,15 +41678,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", @@ -47123,31 +41695,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 { @@ -47193,54 +41766,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, }, }, ], @@ -47250,15 +41776,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 [], } @@ -47393,7 +41925,7 @@ Object { exports[`typescript fixtures/types/function-with-array-destruction.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -47403,7 +41935,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -47413,7 +41945,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -47426,9 +41958,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "a", @@ -47445,16 +41977,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 [], }, @@ -47464,63 +41996,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, @@ -47528,14 +42015,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 [], } @@ -47543,7 +42030,7 @@ Object { exports[`typescript fixtures/types/function-with-object-destruction.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, @@ -47553,7 +42040,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -47563,7 +42050,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -47576,9 +42063,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 0, "from": Object { - "$ref": 2, + "$ref": 1, }, "identifier": Object { "name": "a", @@ -47595,16 +42082,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 [], }, @@ -47614,63 +42101,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, @@ -47678,14 +42120,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 [], } @@ -47947,7 +42389,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -47957,7 +42399,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -47967,7 +42409,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -47982,11 +42424,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -47997,58 +42439,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, @@ -48059,7 +42456,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48067,7 +42464,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48077,7 +42474,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48087,7 +42484,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48102,11 +42499,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48117,58 +42514,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, @@ -48179,7 +42531,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48187,7 +42539,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -48197,7 +42549,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -48207,7 +42559,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -48222,11 +42574,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -48237,58 +42589,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, @@ -48299,7 +42606,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -48457,7 +42764,7 @@ Object { exports[`typescript fixtures/types/intersection-type.src 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, @@ -48467,7 +42774,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, @@ -48477,7 +42784,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, @@ -48490,9 +42797,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 0, "from": Object { - "$ref": 5, + "$ref": 3, }, "identifier": Object { "name": "T", @@ -48503,15 +42810,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", @@ -48522,15 +42827,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", @@ -48541,153 +42844,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 [], } @@ -49506,7 +43732,7 @@ Object { exports[`typescript fixtures/types/nested-types.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49516,7 +43742,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49526,7 +43752,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -49541,11 +43767,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -49556,58 +43782,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, @@ -49618,7 +43799,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -49626,7 +43807,7 @@ Object { exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -49636,7 +43817,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -49646,7 +43827,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -49661,11 +43842,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -49676,58 +43857,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, @@ -49738,7 +43874,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } @@ -51322,269 +45458,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 { @@ -51592,39 +45602,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, }, }, ], @@ -51638,7 +45654,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 [], } @@ -52298,7 +46389,7 @@ Object { exports[`typescript fixtures/types/union-type.src 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, @@ -52308,7 +46399,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, @@ -52318,7 +46409,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, @@ -52333,11 +46424,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 2, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 1, }, "variables": Array [], }, @@ -52348,58 +46439,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, @@ -52410,7 +46456,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], } diff --git a/packages/parser/typings/eslint-scope.d.ts b/packages/parser/typings/eslint-scope.d.ts index 6c231dd5d2bd..a2ab352e337c 100644 --- a/packages/parser/typings/eslint-scope.d.ts +++ b/packages/parser/typings/eslint-scope.d.ts @@ -126,7 +126,7 @@ declare module 'eslint-scope/lib/referencer' { Visitor } from 'eslint-scope/lib/options'; - export default class Referencer extends Visitor { + export default class Referencer> extends Visitor { protected isInnerMethodDefinition: boolean; protected options: any; protected scopeManager: SM; @@ -134,7 +134,7 @@ declare module 'eslint-scope/lib/referencer' { constructor(options: any, scopeManager: SM); - currentScope(): Scope; + currentScope(): SC; close(node: TSESTree.Node): void; pushInnerMethodDefinition(isInnerMethodDefinition: boolean): boolean; popInnerMethodDefinition(isInnerMethodDefinition: boolean): void; @@ -259,10 +259,10 @@ declare module 'eslint-scope/lib/scope' { __delegateToUpperScope(ref: any): void; __addDeclaredVariablesOfNode(variable: any, node: TSESTree.Node): void; __defineGeneric( - name: any, - set: any, - variables: any, - node: any, + name: string, + set: Map, + variables: Variable[], + node: TSESTree.Identifier, def: Definition ): void; @@ -446,14 +446,14 @@ declare module 'eslint-scope/lib/scope-manager' { ecmaVersion?: number; } - export default class ScopeManager { + export default class ScopeManager { protected __options: ScopeManagerOptions; - __currentScope: Scope; - protected __nodeToScope: WeakMap; + __currentScope: SC; + protected __nodeToScope: WeakMap; protected __declaredVariables: WeakMap; - scopes: Scope[]; - globalScope: Scope; + scopes: SC[]; + globalScope: SC; constructor(options: ScopeManagerOptions); @@ -466,28 +466,28 @@ declare module 'eslint-scope/lib/scope-manager' { 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: Scope): Scope; - __nestGlobalScope(node: TSESTree.Node): Scope; - __nestBlockScope(node: TSESTree.Node): Scope; + __nestScope(scope: T): T; + __nestGlobalScope(node: TSESTree.Node): SC; + __nestBlockScope(node: TSESTree.Node): SC; __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; + ): 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; } From 9a6d774a9c5ed4bea2364ac771eb997e10bd02a9 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 01:44:16 +0100 Subject: [PATCH 06/12] chore(parser): fix formatting --- packages/parser/src/analyze-scope.ts | 4 ++-- packages/parser/typings/eslint-scope.d.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index e494b317f682..30df732cbab1 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -16,8 +16,8 @@ import { } from './scope/definition'; import { typeReferencing } from './scope/reference'; import { ScopeManager } from './scope/scope-manager'; -import { PatternVisitor } from "./scope/pattern-visitor"; -import { Scope } from "./scope/scopes"; +import { PatternVisitor } from './scope/pattern-visitor'; +import { Scope } from './scope/scopes'; class Referencer extends OriginalReferencer { protected typeMode: boolean; diff --git a/packages/parser/typings/eslint-scope.d.ts b/packages/parser/typings/eslint-scope.d.ts index a2ab352e337c..4c46e19b2668 100644 --- a/packages/parser/typings/eslint-scope.d.ts +++ b/packages/parser/typings/eslint-scope.d.ts @@ -126,7 +126,10 @@ declare module 'eslint-scope/lib/referencer' { Visitor } from 'eslint-scope/lib/options'; - export default class Referencer> extends Visitor { + export default class Referencer< + SC extends Scope, + SM extends ScopeManager + > extends Visitor { protected isInnerMethodDefinition: boolean; protected options: any; protected scopeManager: SM; @@ -477,10 +480,7 @@ declare module 'eslint-scope/lib/scope-manager' { __nestScope(scope: T): T; __nestGlobalScope(node: TSESTree.Node): SC; __nestBlockScope(node: TSESTree.Node): SC; - __nestFunctionScope( - node: TSESTree.Node, - isMethodDefinition: boolean - ): SC; + __nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): SC; __nestForScope(node: TSESTree.Node): SC; __nestCatchScope(node: TSESTree.Node): SC; __nestWithScope(node: TSESTree.Node): SC; From 7d9bf1aa309fdb8cd736fa5479314b253dd19a42 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 01:52:58 +0100 Subject: [PATCH 07/12] fix(parser): make sure that overrides implements Scope --- packages/parser/src/analyze-scope.ts | 2 +- packages/parser/src/scope/scopes.ts | 10 ++++++---- packages/parser/typings/eslint-scope.d.ts | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 30df732cbab1..62103b296663 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -196,7 +196,7 @@ class Referencer extends OriginalReferencer { 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 0062ac30bd75..d9a7fad6eea4 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 esScope.GlobalScope { +export class GlobalScope extends esScope.GlobalScope implements Scope { setTypes: Map = new Map(); types: Variable[] = []; @@ -88,7 +88,9 @@ export class GlobalScope extends esScope.GlobalScope { } } -export class FunctionExpressionNameScope extends esScope.FunctionExpressionNameScope { +export class FunctionExpressionNameScope + extends esScope.FunctionExpressionNameScope + implements Scope { setTypes: Map = new Map(); types: Variable[] = []; @@ -100,7 +102,7 @@ export class FunctionExpressionNameScope extends esScope.FunctionExpressionNameS } } -export class WithScope extends esScope.WithScope { +export class WithScope extends esScope.WithScope implements Scope { setTypes: Map = new Map(); types: Variable[] = []; @@ -112,7 +114,7 @@ export class WithScope extends esScope.WithScope { } } -export class FunctionScope extends esScope.FunctionScope { +export class FunctionScope extends esScope.FunctionScope implements Scope { setTypes: Map = new Map(); types: Variable[] = []; diff --git a/packages/parser/typings/eslint-scope.d.ts b/packages/parser/typings/eslint-scope.d.ts index 4c46e19b2668..911fe8e0dc06 100644 --- a/packages/parser/typings/eslint-scope.d.ts +++ b/packages/parser/typings/eslint-scope.d.ts @@ -171,8 +171,8 @@ declare module 'eslint-scope/lib/referencer' { AssignmentExpression(node: TSESTree.Node): void; CatchClause(node: TSESTree.Node): void; - Program(node: TSESTree.Node): void; - Identifier(node: TSESTree.Node): void; + Program(node: TSESTree.Program): void; + Identifier(node: TSESTree.Identifier): void; UpdateExpression(node: TSESTree.Node): void; MemberExpression(node: TSESTree.Node): void; Property(node: TSESTree.Node): void; From 7070e8a7457e5c29d538c9cf5623dde274178d53 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 22:00:06 +0100 Subject: [PATCH 08/12] fix(parser): restore some scope logic --- packages/parser/src/scope/scopes.ts | 51 +- .../lib/__snapshots__/scope-analysis.ts.snap | 6062 ++++++--- .../tests/lib/__snapshots__/tsx.ts.snap | 115 +- .../lib/__snapshots__/typescript.ts.snap | 11254 ++++++++++++---- packages/parser/tests/tools/scope-analysis.ts | 50 +- packages/parser/typings/eslint-scope.d.ts | 5 +- 6 files changed, 13160 insertions(+), 4377 deletions(-) diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index d9a7fad6eea4..33e5f5a1441b 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -1,25 +1,15 @@ import * as esScope from 'eslint-scope/lib/scope'; import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import { ScopeManager } from './scope-manager'; -import { Reference } from 'eslint-scope'; import { Definition } from 'eslint-scope/lib/definition'; -import Variable from 'eslint-scope/lib/variable'; export class Scope extends esScope.Scope { - setTypes: Map = new Map(); - types: Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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: Reference): boolean { - return super.__resolve(ref); - } } /** The scope class for enum. */ @@ -67,23 +57,29 @@ export class TypeAliasScope extends Scope { /// eslint scopes export class GlobalScope extends esScope.GlobalScope implements Scope { - setTypes: Map = new Map(); - types: Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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: Definition) { - 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; + } } } } @@ -91,37 +87,28 @@ export class GlobalScope extends esScope.GlobalScope implements Scope { export class FunctionExpressionNameScope extends esScope.FunctionExpressionNameScope implements Scope { - setTypes: Map = new Map(); - types: Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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 esScope.WithScope implements Scope { - setTypes: Map = new Map(); - types: Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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 esScope.FunctionScope implements Scope { - setTypes: Map = new Map(); - types: Variable[] = []; - /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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 8de1f8f788e7..28b6d8b71455 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 aa251ddd0164..384bedec44cc 100644 --- a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap @@ -52,7 +52,7 @@ Object { exports[`TSX fixtures/react-typed-props.src 1`] = ` Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -62,7 +62,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -72,7 +72,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 31, @@ -87,16 +87,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, @@ -109,9 +109,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Props", @@ -122,13 +122,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", @@ -140,45 +142,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 { @@ -214,11 +216,11 @@ Object { "name": "props", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -227,17 +229,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 { @@ -245,7 +246,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -291,11 +292,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 { @@ -331,7 +376,7 @@ Object { "name": "App", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -340,16 +385,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 15b211efa56f..d31981c178a3 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 [], } @@ -1159,7 +1245,7 @@ Object { exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -1169,7 +1255,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -1179,7 +1265,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 7, @@ -1194,11 +1280,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -1209,13 +1295,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, @@ -1226,7 +1357,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -1378,7 +1509,7 @@ Object { exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -1388,7 +1519,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -1398,7 +1529,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1411,9 +1542,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "X", @@ -1424,13 +1555,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", @@ -1441,13 +1574,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", @@ -1459,34 +1594,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 { @@ -1522,11 +1700,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -1535,21 +1713,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 [], }, @@ -1557,19 +1728,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 [], } @@ -2109,7 +2273,7 @@ Object { exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2119,7 +2283,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -2129,7 +2293,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -2142,9 +2306,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "a", @@ -2159,9 +2323,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "a", @@ -2178,19 +2342,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 [], }, @@ -2200,21 +2364,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, @@ -2222,17 +2431,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 [], } @@ -2240,7 +2449,7 @@ Object { exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -2250,7 +2459,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2260,7 +2469,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -2273,9 +2482,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 4, }, "identifier": Object { "name": "a", @@ -2290,9 +2499,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 2, + "$ref": 4, }, "identifier": Object { "name": "a", @@ -2309,26 +2518,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, @@ -2339,11 +2764,11 @@ Object { ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [], }, @@ -2363,19 +2788,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", }, @@ -2385,106 +2810,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", }, @@ -4064,7 +4390,7 @@ Object { exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -4074,7 +4400,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -4084,7 +4410,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -4094,7 +4420,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 23, @@ -4109,15 +4435,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 { @@ -4128,13 +4457,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, @@ -4149,26 +4518,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, }, }, ], @@ -4180,7 +4592,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "C": Object { @@ -4188,7 +4600,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -4228,7 +4640,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -4240,7 +4652,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -4248,7 +4660,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -4288,7 +4700,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -4302,7 +4714,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -4938,7 +5350,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -4948,7 +5360,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -4958,7 +5370,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -4973,19 +5385,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 { @@ -5021,7 +5433,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -5031,9 +5443,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "B", @@ -5048,9 +5460,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "Bar", @@ -5067,27 +5479,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 { @@ -5123,7 +5578,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -5134,17 +5589,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 [], } @@ -5152,7 +5607,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -5162,7 +5617,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5172,7 +5627,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5187,19 +5642,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 { @@ -5235,7 +5690,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -5245,9 +5700,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "B", @@ -5262,9 +5717,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "C", @@ -5279,9 +5734,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "D", @@ -5296,9 +5751,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Bar", @@ -5314,9 +5769,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -5326,22 +5778,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 { @@ -5377,7 +5875,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -5387,9 +5885,6 @@ Object { "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 1, - }, Object { "$ref": 2, }, @@ -5399,12 +5894,15 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [], } @@ -5412,7 +5910,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5422,7 +5920,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5432,7 +5930,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5442,7 +5940,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 20, @@ -5457,15 +5955,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 { @@ -5476,7 +5977,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, }, }, ], @@ -5488,7 +6029,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -5496,7 +6037,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -5536,7 +6077,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -5548,7 +6089,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -5556,7 +6097,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -5596,7 +6137,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -5610,7 +6151,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -5618,7 +6159,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -5628,7 +6169,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5638,7 +6179,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5648,7 +6189,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 20, @@ -5661,9 +6202,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "Bar", @@ -5680,20 +6221,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 { @@ -5704,7 +6248,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, }, }, ], @@ -5715,12 +6299,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -5728,7 +6312,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -5768,7 +6352,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -5779,12 +6363,12 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -5792,7 +6376,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -5832,7 +6416,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -5843,14 +6427,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 [], } @@ -6714,7 +7298,7 @@ Object { exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -6724,7 +7308,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -6734,7 +7318,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -6759,7 +7343,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -6784,7 +7368,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 35, @@ -6799,15 +7383,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 { @@ -6818,13 +7405,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, @@ -6839,26 +7466,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, }, }, ], @@ -6870,7 +7497,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -6878,7 +7505,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -6918,7 +7545,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -6930,7 +7557,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "C": Object { @@ -6938,7 +7565,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -6978,7 +7605,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -6992,7 +7619,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -7000,7 +7627,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 22, + "$id": 26, "block": Object { "range": Array [ 0, @@ -7010,7 +7637,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 21, + "$id": 25, "block": Object { "range": Array [ 0, @@ -7020,7 +7647,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 0, @@ -7030,7 +7657,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 14, "block": Object { "range": Array [ 60, @@ -7045,11 +7672,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [], }, @@ -7058,9 +7685,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 11, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Constructor", @@ -7071,13 +7698,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", @@ -7088,13 +7717,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", @@ -7106,48 +7737,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 { @@ -7183,17 +7858,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, @@ -7208,19 +7883,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 { @@ -7256,13 +7931,13 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 17, }, }, ], }, Object { - "$id": 16, + "$id": 19, "block": Object { "range": Array [ 130, @@ -7277,19 +7952,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 { @@ -7325,13 +8000,13 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 16, + "$ref": 19, }, }, ], }, Object { - "$id": 17, + "$id": 20, "block": Object { "range": Array [ 142, @@ -7346,16 +8021,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, @@ -7368,9 +8043,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 18, + "$id": 22, "from": Object { - "$ref": 20, + "$ref": 24, }, "identifier": Object { "name": "args", @@ -7385,9 +8060,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 19, + "$id": 23, "from": Object { - "$ref": 20, + "$ref": 24, }, "identifier": Object { "name": "T", @@ -7398,36 +8073,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", @@ -7438,13 +8161,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", @@ -7461,9 +8186,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 21, + "$ref": 25, }, "identifier": Object { "name": "C", @@ -7482,29 +8207,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, }, @@ -7513,7 +8232,7 @@ Object { }, }, "variableScope": Object { - "$ref": 21, + "$ref": 25, }, "variables": Array [ Object { @@ -7553,11 +8272,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 4, + "$ref": 6, }, ], "scope": Object { - "$ref": 21, + "$ref": 25, }, }, Object { @@ -7597,7 +8316,7 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 25, }, }, Object { @@ -7635,13 +8354,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, }, }, ], @@ -7652,26 +8459,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 [], } @@ -7679,7 +8474,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -7689,7 +8484,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -7699,7 +8494,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -7712,9 +8507,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "Constructor", @@ -7729,9 +8524,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "M", @@ -7748,9 +8543,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "T", @@ -7761,14 +8556,13 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -7778,10 +8572,13 @@ Object { ], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "Base": Object { + "$ref": 3, + }, + "T": Object { "$ref": 2, }, "arguments": Object { @@ -7789,7 +8586,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -7800,11 +8597,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 { @@ -7840,7 +8681,7 @@ Object { "name": "Base", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -7851,15 +8692,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 { @@ -7867,7 +8705,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -7907,11 +8745,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -7922,17 +8760,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 [], } @@ -11150,7 +11985,7 @@ Object { exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` Object { - "$id": 8, + "$id": 10, "block": Object { "range": Array [ 0, @@ -11160,7 +11995,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -11170,7 +12005,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -11180,7 +12015,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 25, @@ -11195,15 +12030,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 { @@ -11214,13 +12052,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, @@ -11235,26 +12113,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, }, }, ], @@ -11266,7 +12187,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "A": Object { @@ -11274,7 +12195,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -11314,7 +12235,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -11326,7 +12247,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "A": Object { @@ -11334,7 +12255,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -11374,7 +12295,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -11388,7 +12309,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -11396,7 +12317,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -11406,7 +12327,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -11416,7 +12337,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -11431,19 +12352,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 { @@ -11479,7 +12400,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -11491,19 +12412,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 { @@ -11539,7 +12503,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -11553,7 +12517,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -11561,7 +12525,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -11571,7 +12535,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -11581,7 +12545,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -11596,19 +12560,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 { @@ -11644,7 +12608,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -11654,9 +12618,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "Bar", @@ -11673,24 +12637,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 { @@ -11726,7 +12733,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -11737,14 +12744,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 [], } @@ -11752,7 +12759,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -11762,7 +12769,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -11772,7 +12779,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -11787,19 +12794,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 { @@ -11835,7 +12842,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -11847,19 +12854,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 { @@ -11895,7 +12945,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -11909,7 +12959,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -14399,7 +15449,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14409,7 +15459,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -14419,7 +15469,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 15, @@ -14434,11 +15484,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -14449,13 +15499,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, @@ -14466,7 +15561,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -14474,7 +15569,7 @@ Object { exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -14484,7 +15579,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14494,7 +15589,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 15, @@ -14509,11 +15604,11 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -14524,13 +15619,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, @@ -14541,7 +15724,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -14549,7 +15732,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -14559,7 +15742,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -14569,7 +15752,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -14584,19 +15767,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 { @@ -14632,7 +15815,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -14644,19 +15827,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 { @@ -14692,7 +15918,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -14706,7 +15932,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -14714,7 +15940,7 @@ Object { exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -14724,7 +15950,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -14734,7 +15960,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 7, @@ -14749,19 +15975,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 { @@ -14797,7 +16023,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -14809,19 +16035,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 { @@ -14857,7 +16169,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -14871,7 +16183,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -15117,7 +16429,7 @@ Object { exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15127,7 +16439,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15137,7 +16449,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 7, @@ -15152,11 +16464,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -15167,13 +16479,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, @@ -15184,7 +16541,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -15192,7 +16549,7 @@ Object { exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15202,7 +16559,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -15212,7 +16569,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 7, @@ -15227,11 +16584,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -15242,13 +16599,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, @@ -15259,7 +16661,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -15267,7 +16669,7 @@ Object { exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -15277,7 +16679,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15287,7 +16689,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 7, @@ -15300,9 +16702,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -15319,16 +16721,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 [], }, @@ -15338,18 +16740,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, @@ -15357,14 +16804,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 [], } @@ -15372,7 +16819,7 @@ Object { exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -15382,7 +16829,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -15392,7 +16839,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 10, @@ -15405,9 +16852,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "a", @@ -15419,7 +16866,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 4, }, "writeExpr": undefined, }, @@ -15427,18 +16874,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 { @@ -15449,11 +16899,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 { @@ -15489,11 +16979,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -15505,7 +16995,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "obj", @@ -15531,7 +17021,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "obj": Object { @@ -15539,7 +17029,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -15589,7 +17079,7 @@ Object { }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -15603,7 +17093,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } @@ -16771,7 +18261,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -16781,7 +18271,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -16791,7 +18281,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16804,9 +18294,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "X", @@ -16817,13 +18307,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", @@ -16834,13 +18326,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", @@ -16852,33 +18346,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 { @@ -16889,11 +18379,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 { @@ -16929,11 +18466,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 5, + "$ref": 6, }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -16942,17 +18479,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 { @@ -16960,7 +18490,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -17000,7 +18530,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -17009,19 +18539,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 [], } @@ -17029,7 +18552,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, @@ -17039,7 +18562,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17049,7 +18572,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17064,15 +18587,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 { @@ -17083,7 +18609,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, }, }, ], @@ -17095,7 +18661,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "compare": Object { @@ -17103,7 +18669,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -17143,7 +18709,7 @@ Object { "name": "compare", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -17157,7 +18723,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -17165,7 +18731,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -17175,7 +18741,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -17185,7 +18751,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -17198,9 +18764,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "X", @@ -17211,13 +18777,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", @@ -17228,13 +18796,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", @@ -17246,33 +18816,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 { @@ -17283,11 +18849,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 { @@ -17323,11 +18936,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 5, + "$ref": 6, }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -17336,17 +18949,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 { @@ -17354,7 +18960,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -17394,7 +19000,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -17403,19 +19009,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 [], } @@ -18163,7 +19762,7 @@ Object { exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -18173,7 +19772,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -18183,7 +19782,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -18198,16 +19797,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, @@ -18220,9 +19819,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "X", @@ -18237,9 +19836,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "Y", @@ -18254,6 +19853,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, @@ -18288,11 +20106,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, @@ -18316,7 +20179,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 { @@ -18344,39 +20207,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", }, @@ -18386,14 +20232,11 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, ], - "type": "type-alias", + "type": "interface", "upperScope": Object { "$ref": 3, }, @@ -18408,9 +20251,6 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -18419,119 +20259,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, @@ -18539,14 +20316,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 [], } @@ -18554,7 +20331,7 @@ Object { exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -18564,7 +20341,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -18574,7 +20351,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -18587,9 +20364,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "Bar", @@ -18604,9 +20381,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "Baz", @@ -18623,19 +20400,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 [], }, @@ -18645,21 +20422,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, @@ -18667,17 +20489,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 [], } @@ -18685,7 +20507,7 @@ Object { exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -18695,7 +20517,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -18705,7 +20527,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -18720,11 +20542,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -18735,13 +20557,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, @@ -18752,7 +20662,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -18760,7 +20670,7 @@ Object { exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 18, + "$id": 21, "block": Object { "range": Array [ 0, @@ -18770,7 +20680,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 17, + "$id": 20, "block": Object { "range": Array [ 0, @@ -18780,7 +20690,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 19, "block": Object { "range": Array [ 0, @@ -18793,9 +20703,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 3, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "bax", @@ -18810,9 +20720,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "baz", @@ -18827,9 +20737,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -18844,9 +20754,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -18861,9 +20771,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 7, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -18878,9 +20788,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 8, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "loo", @@ -18895,9 +20805,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 9, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -18912,9 +20822,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -18929,9 +20839,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 11, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -18946,9 +20856,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 12, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -18963,9 +20873,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 13, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -18980,9 +20890,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 11, + "$id": 14, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "c", @@ -18997,9 +20907,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 15, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -19014,9 +20924,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 16, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -19031,9 +20941,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 17, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "a", @@ -19048,9 +20958,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 15, + "$id": 18, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "b", @@ -19066,15 +20976,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, Object { "$ref": 3, }, @@ -19114,95 +21015,228 @@ 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, - }, - Object { + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "J", + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 221, + 224, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "J", + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + }, + ], + "name": "J", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "F", + "range": Array [ + 275, + 276, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 274, + 277, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "F", + "range": Array [ + 275, + 276, + ], + "type": "Identifier", + }, + ], + "name": "F", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { "$ref": 14, }, Object { "$ref": 15, }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, ], "type": "module", "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, + 295, + ], + "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, }, @@ -19242,12 +21276,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 [], } @@ -19255,7 +21298,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, @@ -19265,7 +21308,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19275,7 +21318,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19288,9 +21331,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "x", @@ -19305,9 +21348,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "y", @@ -19324,19 +21367,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 [], }, @@ -19346,21 +21389,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, @@ -19368,17 +21456,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 [], } @@ -19386,7 +21474,7 @@ Object { exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19396,7 +21484,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19406,7 +21494,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -19419,9 +21507,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -19438,16 +21526,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 [], }, @@ -19457,18 +21545,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, @@ -19476,14 +21609,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 [], } @@ -19491,7 +21624,7 @@ Object { exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19501,7 +21634,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -19511,7 +21644,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19524,9 +21657,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 4, }, "identifier": Object { "name": "Bar", @@ -19541,9 +21674,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 2, + "$ref": 4, }, "identifier": Object { "name": "J", @@ -19560,19 +21693,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 [], }, @@ -19582,21 +21715,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, @@ -19604,17 +21825,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 [], } @@ -19622,7 +21843,7 @@ Object { exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19632,7 +21853,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19642,7 +21863,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -19657,11 +21878,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -19672,13 +21893,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, @@ -19689,7 +21998,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -19697,7 +22006,7 @@ Object { exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19707,7 +22016,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19717,7 +22026,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -19730,9 +22039,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -19749,16 +22058,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 [], }, @@ -19768,18 +22077,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, @@ -19787,14 +22141,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 [], } @@ -19802,7 +22156,7 @@ Object { exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -19812,7 +22166,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19822,7 +22176,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19835,9 +22189,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "bar", @@ -19852,9 +22206,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "bar", @@ -19869,9 +22223,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -19882,13 +22236,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", @@ -19899,14 +22255,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, }, @@ -19932,9 +22532,6 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -19949,192 +22546,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 [], } @@ -20142,7 +22624,7 @@ Object { exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -20152,7 +22634,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -20162,7 +22644,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -20177,11 +22659,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -20192,13 +22674,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, @@ -20209,7 +22736,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -20217,7 +22744,7 @@ Object { exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -20227,7 +22754,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -20237,7 +22764,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -20250,9 +22777,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "foo", @@ -20269,16 +22796,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 [], }, @@ -20288,18 +22815,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, @@ -20307,14 +22879,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 [], } @@ -21358,7 +23930,7 @@ Object { exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, @@ -21368,7 +23940,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, @@ -21378,7 +23950,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 29, @@ -21393,15 +23965,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 { @@ -21412,13 +23987,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, @@ -21433,32 +24048,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, @@ -21473,32 +24131,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, @@ -21513,33 +24171,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 { @@ -21575,7 +24233,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, ], @@ -21587,7 +24245,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "foo", @@ -21613,7 +24271,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 14, }, "variableMap": Object { "foo": Object { @@ -21621,7 +24279,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 13, }, "variables": Array [ Object { @@ -21671,7 +24329,7 @@ Object { }, ], "scope": Object { - "$ref": 11, + "$ref": 13, }, }, ], @@ -21685,7 +24343,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, "variables": Array [], } @@ -21952,7 +24610,7 @@ Object { exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -21962,7 +24620,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -21972,7 +24630,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -21985,9 +24643,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "Success", @@ -22002,9 +24660,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -22015,13 +24673,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", @@ -22038,24 +24698,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, @@ -22063,24 +24769,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, @@ -22088,20 +24836,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 [], } @@ -22109,7 +24854,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, @@ -22119,7 +24864,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -22129,7 +24874,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -22142,9 +24887,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "Success", @@ -22159,9 +24904,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -22172,13 +24917,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", @@ -22195,24 +24942,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, @@ -22220,24 +25013,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, @@ -22245,20 +25080,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 [], } @@ -22266,7 +25098,7 @@ Object { exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22276,7 +25108,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22286,7 +25118,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -22301,11 +25133,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -22316,13 +25148,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, @@ -22333,7 +25210,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -23169,7 +26046,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-interface.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -23179,7 +26056,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -23189,7 +26066,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -23202,9 +26079,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "node", @@ -23219,9 +26096,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "node", @@ -23238,19 +26115,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 [], }, @@ -23260,21 +26137,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, @@ -23282,17 +26204,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 [], } @@ -23585,7 +26507,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` Object { - "$id": 10, + "$id": 12, "block": Object { "range": Array [ 0, @@ -23595,7 +26517,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 11, "block": Object { "range": Array [ 0, @@ -23605,7 +26527,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 44, @@ -23620,15 +26542,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 { @@ -23639,13 +26564,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, @@ -23658,9 +26623,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 8, + "$ref": 10, }, "identifier": Object { "name": "Foo", @@ -23677,31 +26642,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, }, }, ], @@ -23713,7 +26721,7 @@ Object { Object { "$id": 2, "from": Object { - "$ref": 9, + "$ref": 11, }, "identifier": Object { "name": "A", @@ -23730,7 +26738,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 9, + "$ref": 11, }, "identifier": Object { "name": "foo", @@ -23753,12 +26761,12 @@ Object { "$ref": 3, }, Object { - "$ref": 7, + "$ref": 9, }, ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 12, }, "variableMap": Object { "bar": Object { @@ -23769,7 +26777,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 11, }, "variables": Array [ Object { @@ -23809,7 +26817,7 @@ Object { "name": "bar", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 11, }, }, Object { @@ -23849,7 +26857,7 @@ Object { "name": "baz", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 11, }, }, ], @@ -23866,14 +26874,14 @@ Object { "$ref": 3, }, Object { - "$ref": 7, + "$ref": 9, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 12, }, "variables": Array [], } @@ -23881,7 +26889,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 17, + "$id": 20, "block": Object { "range": Array [ 0, @@ -23891,7 +26899,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 19, "block": Object { "range": Array [ 0, @@ -23901,7 +26909,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 10, "block": Object { "range": Array [ 0, @@ -23916,19 +26924,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 { @@ -23964,13 +26972,13 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 10, }, }, ], }, Object { - "$id": 9, + "$id": 12, "block": Object { "range": Array [ 75, @@ -23985,19 +26993,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 { @@ -24033,13 +27041,13 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 12, }, }, ], }, Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 165, @@ -24052,9 +27060,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 10, + "$id": 13, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "bar2", @@ -24065,13 +27073,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", @@ -24082,30 +27092,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, @@ -24118,9 +27130,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 13, + "$id": 16, "from": Object { - "$ref": 15, + "$ref": 18, }, "identifier": Object { "name": "bar", @@ -24131,13 +27143,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", @@ -24148,25 +27162,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 [], }, @@ -24175,9 +27191,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 16, + "$ref": 19, }, "identifier": Object { "name": "A", @@ -24188,13 +27204,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", @@ -24205,13 +27223,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", @@ -24222,13 +27242,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", @@ -24238,55 +27260,175 @@ Object { ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 10, - }, - Object { - "$ref": 11, - }, - Object { - "$ref": 13, + "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": 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 { @@ -24322,11 +27464,11 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 16, + "$ref": 19, }, }, Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -24362,7 +27504,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, }, }, ], @@ -24371,37 +27607,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 [], } @@ -24604,7 +27815,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24614,7 +27825,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24624,7 +27835,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24639,11 +27850,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -24654,13 +27865,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, @@ -24671,7 +27927,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -24679,7 +27935,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24689,7 +27945,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24699,7 +27955,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24714,11 +27970,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -24729,13 +27985,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, @@ -24746,7 +28047,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -24754,7 +28055,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24764,7 +28065,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24774,7 +28075,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24789,11 +28090,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -24804,13 +28105,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, @@ -24821,7 +28167,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -24829,7 +28175,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24839,7 +28185,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24849,7 +28195,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24864,11 +28210,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -24879,13 +28225,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, @@ -24896,7 +28287,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -24904,7 +28295,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24914,7 +28305,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24924,7 +28315,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -24939,11 +28330,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -24954,13 +28345,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, @@ -24971,7 +28407,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -24979,7 +28415,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -24989,7 +28425,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24999,7 +28435,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25011,31 +28447,76 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "type-alias", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "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, + 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, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], }, ], "functionExpressionScope": false, @@ -25046,7 +28527,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -25054,7 +28535,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25064,7 +28545,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25074,7 +28555,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25089,11 +28570,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -25104,13 +28585,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, @@ -25121,7 +28647,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -25129,7 +28655,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25139,7 +28665,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25149,7 +28675,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25164,11 +28690,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -25179,13 +28705,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, @@ -25196,7 +28767,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -25204,7 +28775,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25214,7 +28785,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25224,7 +28795,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25239,11 +28810,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -25254,13 +28825,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, @@ -25271,7 +28887,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -25279,7 +28895,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25289,7 +28905,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25299,7 +28915,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25314,11 +28930,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -25329,13 +28945,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, @@ -25346,7 +29007,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -25354,7 +29015,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25364,7 +29025,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25374,7 +29035,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25389,11 +29050,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -25404,13 +29065,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, @@ -25421,7 +29127,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -25429,7 +29135,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25439,7 +29145,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25449,7 +29155,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25464,11 +29170,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -25479,13 +29185,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, @@ -25496,7 +29247,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -25504,7 +29255,7 @@ Object { exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25514,7 +29265,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25524,7 +29275,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25539,11 +29290,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -25554,13 +29305,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, @@ -25571,7 +29367,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -25579,7 +29375,7 @@ Object { exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -25589,7 +29385,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -25599,7 +29395,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -25612,9 +29408,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "bar", @@ -25629,9 +29425,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "bar", @@ -25646,9 +29442,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -25659,13 +29455,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", @@ -25676,17 +29474,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, }, @@ -25696,25 +29490,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, }, @@ -25724,25 +29564,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, }, @@ -25754,7 +29633,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } @@ -25762,7 +29641,7 @@ Object { exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -25772,7 +29651,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -25782,7 +29661,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -25795,9 +29674,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "onclick", @@ -25812,9 +29691,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "this", @@ -25829,9 +29708,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "e", @@ -25846,9 +29725,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "Event", @@ -25864,9 +29743,6 @@ Object { }, ], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -25876,14 +29752,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 [], }, @@ -25892,9 +29771,6 @@ Object { "isStrict": true, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -25904,25 +29780,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, }, @@ -25932,12 +29853,15 @@ Object { Object { "$ref": 3, }, + Object { + "$ref": 4, + }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -25945,7 +29869,7 @@ Object { exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -25955,7 +29879,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -25965,7 +29889,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -25980,11 +29904,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -25995,13 +29919,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, @@ -26012,7 +29981,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -27415,7 +31384,7 @@ Object { exports[`typescript fixtures/declare/interface.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -27425,7 +31394,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -27435,7 +31404,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -27450,11 +31419,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -27465,13 +31434,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, @@ -27482,7 +31496,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -27730,7 +31744,7 @@ Object { exports[`typescript fixtures/declare/type-alias.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -27740,7 +31754,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -27750,7 +31764,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -27765,11 +31779,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -27780,13 +31794,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, @@ -27797,7 +31856,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -34538,7 +38597,7 @@ Object { exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -34548,7 +38607,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -34558,7 +38617,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -34573,11 +38632,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -34588,13 +38647,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, @@ -34605,7 +38709,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -35879,7 +39983,7 @@ Object { exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35889,7 +39993,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35899,7 +40003,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -35914,11 +40018,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -35929,13 +40033,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, @@ -35946,7 +40095,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36074,7 +40223,7 @@ Object { exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36084,7 +40233,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36094,7 +40243,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36109,11 +40258,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -36124,13 +40273,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, @@ -36141,7 +40335,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36149,7 +40343,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36159,7 +40353,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36169,7 +40363,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36184,11 +40378,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -36199,13 +40393,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, @@ -36216,7 +40455,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36224,7 +40463,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36234,7 +40473,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36244,7 +40483,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36259,11 +40498,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -36274,13 +40513,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, @@ -36291,7 +40575,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36299,7 +40583,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36309,7 +40593,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36319,7 +40603,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36334,11 +40618,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -36349,13 +40633,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, @@ -36366,7 +40695,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36374,7 +40703,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36384,7 +40713,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36394,7 +40723,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36409,11 +40738,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -36424,13 +40753,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, @@ -36441,7 +40815,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36449,7 +40823,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36459,7 +40833,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36469,7 +40843,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36484,11 +40858,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -36499,13 +40873,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, @@ -36516,7 +40935,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36524,7 +40943,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36534,7 +40953,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36544,7 +40963,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36559,11 +40978,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -36574,13 +40993,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, @@ -36591,7 +41055,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36599,7 +41063,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36609,7 +41073,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36619,7 +41083,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -36634,11 +41098,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -36649,13 +41113,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, @@ -36666,7 +41175,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36674,7 +41183,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36684,7 +41193,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36694,7 +41203,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36707,9 +41216,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -36726,16 +41235,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 [], }, @@ -36745,18 +41254,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, @@ -36764,14 +41318,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 [], } @@ -36779,7 +41333,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36789,7 +41343,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36799,7 +41353,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36812,9 +41366,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -36831,16 +41385,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 [], }, @@ -36850,18 +41404,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, @@ -36869,14 +41468,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 [], } @@ -36884,7 +41483,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-protected.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36894,7 +41493,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36904,7 +41503,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36917,9 +41516,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -36936,16 +41535,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 [], }, @@ -36955,18 +41554,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, @@ -36974,14 +41618,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 [], } @@ -36989,7 +41633,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36999,7 +41643,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37009,7 +41653,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37022,9 +41666,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -37041,16 +41685,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 [], }, @@ -37060,18 +41704,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, @@ -37079,14 +41768,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 [], } @@ -37094,7 +41783,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -37104,7 +41793,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37114,7 +41803,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37127,9 +41816,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "bar", @@ -37146,16 +41835,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 [], }, @@ -37165,18 +41854,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, @@ -37184,14 +41918,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 [], } @@ -37199,7 +41933,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -37209,7 +41943,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -37219,7 +41953,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37232,9 +41966,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "bar", @@ -37249,9 +41983,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 3, }, "identifier": Object { "name": "baz", @@ -37268,19 +42002,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 [], }, @@ -37290,21 +42024,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, @@ -37312,17 +42091,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 [], } @@ -37330,7 +42109,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37340,7 +42119,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37350,7 +42129,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -37365,11 +42144,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -37380,13 +42159,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, @@ -37397,7 +42221,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37405,7 +42229,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37415,7 +42239,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37425,7 +42249,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -37440,11 +42264,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -37455,13 +42279,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, @@ -37472,7 +42341,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37480,7 +42349,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37490,7 +42359,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37500,7 +42369,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -37515,11 +42384,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -37530,13 +42399,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, + 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, @@ -37547,7 +42461,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37555,7 +42469,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37565,7 +42479,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37575,7 +42489,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -37590,11 +42504,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -37605,13 +42519,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, @@ -37622,7 +42581,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37630,7 +42589,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-static.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37640,7 +42599,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37650,7 +42609,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -37665,11 +42624,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -37680,13 +42639,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, @@ -37697,7 +42701,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37705,7 +42709,7 @@ Object { exports[`typescript fixtures/errorRecovery/interface-property-with-default-value.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37715,7 +42719,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37725,7 +42729,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -37740,11 +42744,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -37755,13 +42759,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, @@ -37772,7 +42821,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -39303,7 +44352,7 @@ Object { exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` Object { - "$id": 15, + "$id": 16, "block": Object { "range": Array [ 0, @@ -39313,7 +44362,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 15, "block": Object { "range": Array [ 0, @@ -39323,7 +44372,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 13, + "$id": 14, "block": Object { "range": Array [ 9, @@ -39475,7 +44524,7 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 13, + "$ref": 14, }, "variableMap": Object { "Point": Object { @@ -39483,7 +44532,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, "variables": Array [ Object { @@ -39529,7 +44578,7 @@ Object { ], }, Object { - "$id": 12, + "$id": 13, "block": Object { "range": Array [ 156, @@ -39539,7 +44588,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 173, @@ -39554,11 +44603,11 @@ Object { "throughReferences": Array [], "type": "interface", "upperScope": Object { - "$ref": 12, + "$ref": 13, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, "variables": Array [], }, @@ -39569,13 +44618,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, @@ -39584,7 +44678,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 13, + "$ref": 14, }, "identifier": Object { "name": "x", @@ -39614,7 +44708,7 @@ Object { ], "type": "block", "upperScope": Object { - "$ref": 14, + "$ref": 15, }, "variableMap": Object { "B": Object { @@ -39625,7 +44719,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, "variables": Array [ Object { @@ -39665,7 +44759,7 @@ Object { "name": "Point", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 14, }, }, Object { @@ -39705,7 +44799,7 @@ Object { "name": "B", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 14, }, }, ], @@ -39717,7 +44811,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 15, + "$ref": 16, }, "variableMap": Object { "A": Object { @@ -39728,7 +44822,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 15, }, "variables": Array [ Object { @@ -39768,7 +44862,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 15, }, }, Object { @@ -39818,7 +44912,7 @@ Object { }, ], "scope": Object { - "$ref": 14, + "$ref": 15, }, }, ], @@ -39832,7 +44926,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 16, }, "variables": Array [], } @@ -39890,7 +44984,7 @@ Object { exports[`typescript fixtures/types/array-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39900,7 +44994,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -39910,7 +45004,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -39925,11 +45019,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -39940,13 +45034,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, @@ -39957,7 +45096,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -40066,7 +45205,7 @@ Object { exports[`typescript fixtures/types/conditional-infer.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -40076,7 +45215,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -40086,7 +45225,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -40099,9 +45238,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -40112,13 +45251,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", @@ -40133,9 +45274,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "U", @@ -40150,9 +45291,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -40162,34 +45303,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, @@ -40197,27 +45386,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, @@ -40225,23 +45453,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 [], } @@ -40249,7 +45471,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` Object { - "$id": 13, + "$id": 15, "block": Object { "range": Array [ 0, @@ -40259,7 +45481,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, @@ -40269,7 +45491,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, @@ -40282,9 +45504,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -40295,13 +45517,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", @@ -40316,9 +45540,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -40333,9 +45557,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -40346,13 +45570,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", @@ -40367,9 +45593,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 7, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -40384,9 +45610,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 8, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -40397,13 +45623,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", @@ -40418,9 +45646,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -40435,9 +45663,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 11, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "U", @@ -40452,9 +45680,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 10, + "$id": 12, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "T", @@ -40465,148 +45693,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 [], } @@ -40614,7 +45911,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -40624,7 +45921,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -40634,7 +45931,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -40647,9 +45944,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "T", @@ -40660,13 +45957,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", @@ -40681,9 +45980,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "U", @@ -40698,9 +45997,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "U", @@ -40717,27 +46016,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, @@ -40745,27 +46090,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, @@ -40773,23 +46160,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 [], } @@ -41048,7 +46432,7 @@ Object { exports[`typescript fixtures/types/constructor-generic.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -41058,7 +46442,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -41071,9 +46455,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "a", @@ -41088,9 +46472,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -41101,13 +46485,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", @@ -41118,32 +46504,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 { @@ -41189,7 +46574,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, }, }, ], @@ -41199,21 +46631,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 [], } @@ -41625,7 +47051,7 @@ Object { exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -41635,7 +47061,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -41648,9 +47074,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "a", @@ -41665,9 +47091,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -41678,13 +47104,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", @@ -41695,32 +47123,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 { @@ -41766,7 +47193,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, }, }, ], @@ -41776,21 +47250,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 [], } @@ -41925,7 +47393,7 @@ Object { exports[`typescript fixtures/types/function-with-array-destruction.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -41935,7 +47403,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -41945,7 +47413,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -41958,9 +47426,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -41977,16 +47445,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 [], }, @@ -41996,18 +47464,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, @@ -42015,14 +47528,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 [], } @@ -42030,7 +47543,7 @@ Object { exports[`typescript fixtures/types/function-with-object-destruction.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -42040,7 +47553,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -42050,7 +47563,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42063,9 +47576,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "a", @@ -42082,16 +47595,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 [], }, @@ -42101,18 +47614,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, @@ -42120,14 +47678,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 [], } @@ -42389,7 +47947,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -42399,7 +47957,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42409,7 +47967,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42424,11 +47982,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -42439,13 +47997,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, @@ -42456,7 +48059,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -42464,7 +48067,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -42474,7 +48077,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42484,7 +48087,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42499,11 +48102,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -42514,13 +48117,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, @@ -42531,7 +48179,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -42539,7 +48187,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -42549,7 +48197,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -42559,7 +48207,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -42574,11 +48222,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -42589,13 +48237,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, @@ -42606,7 +48299,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -42764,7 +48457,7 @@ Object { exports[`typescript fixtures/types/intersection-type.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -42774,7 +48467,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -42784,7 +48477,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -42797,9 +48490,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 2, "from": Object { - "$ref": 3, + "$ref": 5, }, "identifier": Object { "name": "T", @@ -42810,13 +48503,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", @@ -42827,13 +48522,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", @@ -42844,76 +48541,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 [], } @@ -43732,7 +49506,7 @@ Object { exports[`typescript fixtures/types/nested-types.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43742,7 +49516,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43752,7 +49526,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -43767,11 +49541,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -43782,13 +49556,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, @@ -43799,7 +49618,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -43807,7 +49626,7 @@ Object { exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -43817,7 +49636,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -43827,7 +49646,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -43842,11 +49661,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -43857,13 +49676,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, @@ -43874,7 +49738,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -45458,143 +51322,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 { @@ -45602,123 +51592,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, @@ -45729,7 +51638,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -46389,7 +52298,7 @@ Object { exports[`typescript fixtures/types/union-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -46399,7 +52308,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -46409,7 +52318,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, @@ -46424,11 +52333,11 @@ Object { "throughReferences": Array [], "type": "type-alias", "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -46439,13 +52348,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, @@ -46456,7 +52410,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts index dfcb06188754..ecd36e6f2365 100644 --- a/packages/parser/tests/tools/scope-analysis.ts +++ b/packages/parser/tests/tools/scope-analysis.ts @@ -1,4 +1,8 @@ /** Reference resolver. */ +import { Reference, Variable } from "eslint-scope"; +import { Scope } from "../../src/scope/scopes"; +import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/typescript-estree"; + export class ReferenceResolver { map: Map; @@ -6,7 +10,7 @@ export class ReferenceResolver { this.map = new Map(); } - resolve(obj: any, properties: any) { + resolve(obj: any, properties: T): T & { $id: number } { const resolved = Object.assign({ $id: this.map.size }, properties); this.map.set(obj, resolved); return resolved; @@ -29,28 +33,28 @@ export class ReferenceResolver { /** * Convert a given node object to JSON object. * This saves only type and range to know what the node is. - * @param {ASTNode} node The AST node object. - * @returns {Object} The object that can be used for JSON.stringify. + * @param node The AST node object. + * @returns The object that can be used for JSON.stringify. */ -export function nodeToJSON(node: any) { +export function nodeToJSON(node: TSESTree.Node | null): any { if (!node) { return node; } - const { type, name, range } = node; - if (node.type === 'Identifier') { - return { type, name, range }; + const { type, range } = node; + if (node.type === AST_NODE_TYPES.Identifier) { + return { type, name: node.name, range }; } return { type, range }; } /** * Convert a given variable object to JSON object. - * @param {Variable} variable The eslint-scope's variable object. - * @param {ReferenceResolver} resolver The reference resolver. + * @param variable The eslint-scope's variable object. + * @param resolver The reference resolver. * @returns {Object} The object that can be used for JSON.stringify. */ -export function variableToJSON(variable: any, resolver: any) { +export function variableToJSON(variable: Variable, resolver: ReferenceResolver) { const { name, eslintUsed } = variable; const defs = variable.defs.map((d: any) => ({ type: d.type, @@ -74,11 +78,14 @@ export function variableToJSON(variable: any, resolver: any) { /** * Convert a given reference object to JSON object. - * @param {Reference} reference The eslint-scope's reference object. - * @param {ReferenceResolver} resolver The reference resolver. - * @returns {Object} The object that can be used for JSON.stringify. + * @param reference The eslint-scope's reference object. + * @param resolver The reference resolver. + * @returns The object that can be used for JSON.stringify. */ -export function referenceToJSON(reference: any, resolver: any) { +export function referenceToJSON( + reference: Reference, + resolver: ReferenceResolver +) { const kind = `${reference.isRead() ? 'r' : ''}${ reference.isWrite() ? 'w' : '' }`; @@ -98,11 +105,14 @@ export function referenceToJSON(reference: any, resolver: any) { /** * Convert a given scope object to JSON object. - * @param {Scope} scope The eslint-scope's scope object. - * @param {ReferenceResolver} resolver The reference resolver. + * @param scope The eslint-scope's scope object. + * @param resolver The reference resolver. * @returns {Object} The object that can be used for JSON.stringify. */ -export function scopeToJSON(scope: any, resolver = new ReferenceResolver()) { +export function scopeToJSON( + scope: Scope, + resolver = new ReferenceResolver() +): any { const { type, functionExpressionScope, isStrict } = scope; const block = nodeToJSON(scope.block); const variables = scope.variables.map((v: any) => @@ -121,8 +131,8 @@ export function scopeToJSON(scope: any, resolver = new ReferenceResolver()) { 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: any) => - scopeToJSON(c, resolver) + const childScopes = scope.childScopes.map(c => + scopeToJSON(c as Scope, resolver) ); return resolver.resolve(scope, { @@ -145,7 +155,7 @@ export function getScopeTree(scopeManager: any) { // Do the postprocess to test. // https://github.com/eslint/eslint/blob/84ce72fdeba082b7b132e4ac6b714fb1a93831b7/lib/linter.js#L112-L129 - globalScope.through = globalScope.through.filter((reference: any) => { + globalScope.through = globalScope.through.filter((reference: Reference) => { const name = reference.identifier.name; const variable = globalScope.set.get(name); if (variable) { diff --git a/packages/parser/typings/eslint-scope.d.ts b/packages/parser/typings/eslint-scope.d.ts index 911fe8e0dc06..c937a41db43f 100644 --- a/packages/parser/typings/eslint-scope.d.ts +++ b/packages/parser/typings/eslint-scope.d.ts @@ -42,6 +42,7 @@ declare module 'eslint-scope/lib/variable' { defs: Definition[]; eslintUsed?: boolean; stack?: any; + scope?: any; tainted?: boolean; } } @@ -205,7 +206,7 @@ declare module 'eslint-scope/lib/referencer' { declare module 'eslint-scope/lib/scope' { import { TSESTree } from '@typescript-eslint/typescript-estree'; - import Reference from 'eslint-scope/lib/reference'; + import Reference, { ReferenceFlag } from 'eslint-scope/lib/reference'; import Variable from 'eslint-scope/lib/variable'; import ScopeManager from 'eslint-scope/lib/scope-manager'; import { Definition } from 'eslint-scope/lib/definition'; @@ -273,7 +274,7 @@ declare module 'eslint-scope/lib/scope' { __referencing( node: TSESTree.Node, - assign?: number, + assign?: ReferenceFlag, writeExpr?: TSESTree.Node, maybeImplicitGlobal?: any, partial?: any, From 6d06f217272ed66b9dc88e8c95b649ae9e7ea730 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 22:15:07 +0100 Subject: [PATCH 09/12] fix(parser): fix visiting classes and add setTypes --- packages/parser/src/analyze-scope.ts | 21 +- packages/parser/src/scope/scopes.ts | 177 +- .../tests/lib/__snapshots__/basics.ts.snap | 23 + .../lib/__snapshots__/javascript.ts.snap | 999 ++++ .../tests/lib/__snapshots__/jsx.ts.snap | 54 + .../lib/__snapshots__/scope-analysis.ts.snap | 2036 +++++--- .../tests/lib/__snapshots__/tsx.ts.snap | 13 +- .../lib/__snapshots__/typescript.ts.snap | 4507 ++++++++++------- packages/parser/tests/tools/scope-analysis.ts | 8 + 9 files changed, 5243 insertions(+), 2595 deletions(-) diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 62103b296663..07f6ab3d4eeb 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -142,7 +142,24 @@ class Referencer extends OriginalReferencer { * @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 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 Definition('ClassName', node.id, node) + ); + } const upperTypeMode = this.typeMode; this.typeMode = true; @@ -157,7 +174,9 @@ class Referencer extends OriginalReferencer { } 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 33e5f5a1441b..570334499ea2 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -1,14 +1,49 @@ import * as esScope from 'eslint-scope/lib/scope'; import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import { ScopeManager } from './scope-manager'; +import { Reference } from 'eslint-scope'; import { Definition } from 'eslint-scope/lib/definition'; +import Variable from 'eslint-scope/lib/variable'; export class Scope extends esScope.Scope { + setTypes: Map = new Map(); + types: Variable[] = []; + /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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: Reference) { + 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: Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + return super.__resolve(ref); } } @@ -57,10 +92,43 @@ export class TypeAliasScope extends Scope { /// eslint scopes export class GlobalScope extends esScope.GlobalScope implements Scope { + setTypes: Map = new Map(); + types: Variable[] = []; + + __resolveType(ref: Reference) { + 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: Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + return super.__resolve(ref); + } + /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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); @@ -87,28 +155,127 @@ export class GlobalScope extends esScope.GlobalScope implements Scope { export class FunctionExpressionNameScope extends esScope.FunctionExpressionNameScope implements Scope { + setTypes: Map = new Map(); + types: Variable[] = []; + + __resolveType(ref: Reference) { + 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: Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + return super.__resolve(ref); + } + /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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 esScope.WithScope implements Scope { + setTypes: Map = new Map(); + types: Variable[] = []; + + __resolveType(ref: Reference) { + 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: Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + return super.__resolve(ref); + } + /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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 esScope.FunctionScope implements Scope { + setTypes: Map = new Map(); + types: Variable[] = []; + + __resolveType(ref: Reference) { + 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: Reference): boolean { + if (ref.typeMode && this.__resolveType(ref)) { + return true; + } + return super.__resolve(ref); + } + /** @internal */ __defineType(node: TSESTree.Node, def: Definition) { 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 adcfbb880ba8..1ba71b29cc01 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 { @@ -14514,6 +14800,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -14592,6 +14879,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -14652,6 +14940,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -14712,6 +15001,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14793,6 +15083,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -14871,6 +15162,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -14931,6 +15223,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -14991,6 +15284,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15062,6 +15356,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15140,6 +15435,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15200,6 +15496,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15271,6 +15568,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15377,6 +15675,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15396,6 +15695,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15467,6 +15767,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15573,6 +15874,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15592,6 +15894,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15663,6 +15966,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -15853,6 +16157,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -15923,6 +16228,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15980,6 +16286,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -15999,6 +16306,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16128,6 +16436,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16156,6 +16465,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16217,6 +16527,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -16287,6 +16598,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16344,6 +16656,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16363,6 +16676,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16420,6 +16734,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16439,6 +16754,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16494,6 +16810,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -16611,6 +16928,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -16671,6 +16989,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -16731,6 +17050,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16837,6 +17157,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -16962,6 +17283,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -17022,6 +17344,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -17082,6 +17405,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17188,6 +17512,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -17313,6 +17638,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -17373,6 +17699,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -17433,6 +17760,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17488,6 +17816,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17605,6 +17934,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -17665,6 +17995,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -17725,6 +18056,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17780,6 +18112,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17897,6 +18230,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -17957,6 +18291,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -18017,6 +18352,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18123,6 +18459,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -18248,6 +18585,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -18308,6 +18646,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -18368,6 +18707,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18474,6 +18814,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -18599,6 +18940,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -18659,6 +19001,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -18719,6 +19062,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18774,6 +19118,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -18891,6 +19236,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -18951,6 +19297,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -19011,6 +19358,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19121,6 +19469,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -19146,6 +19495,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19356,6 +19706,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -19545,6 +19896,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19705,6 +20057,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -19888,6 +20241,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20048,6 +20402,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -20231,6 +20586,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20390,6 +20746,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -20523,6 +20880,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20657,6 +21015,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -20787,6 +21146,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20893,6 +21253,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -20969,6 +21330,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21179,6 +21541,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -21368,6 +21731,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21509,6 +21873,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -21537,6 +21902,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21643,6 +22009,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -21719,6 +22086,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21929,6 +22297,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -22118,6 +22487,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22278,6 +22648,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -22461,6 +22832,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22621,6 +22993,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -22804,6 +23177,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22964,6 +23338,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -23147,6 +23522,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23306,6 +23682,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -23439,6 +23816,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23573,6 +23951,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -23703,6 +24082,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23811,6 +24191,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -23845,6 +24226,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -23860,6 +24242,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "catch", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -23919,6 +24302,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -24050,6 +24434,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -24110,6 +24495,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24218,6 +24604,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -24252,6 +24639,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -24267,6 +24655,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "catch", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -24326,6 +24715,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -24457,6 +24847,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -24517,6 +24908,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24594,6 +24986,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -24616,6 +25009,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24700,6 +25094,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -24722,6 +25117,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24808,6 +25204,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -24931,6 +25328,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25017,6 +25415,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25140,6 +25539,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25201,6 +25601,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -25271,6 +25672,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25332,6 +25734,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -25402,6 +25805,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25473,6 +25877,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25551,6 +25956,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25611,6 +26017,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25682,6 +26089,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25760,6 +26168,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25820,6 +26229,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25916,6 +26326,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -26041,6 +26452,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -26101,6 +26513,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26146,6 +26559,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26263,6 +26677,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -26323,6 +26738,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26378,6 +26794,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26495,6 +26912,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function-expression-name", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -26555,6 +26973,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -26570,6 +26989,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26615,6 +27035,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26732,6 +27153,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -26792,6 +27214,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26837,6 +27260,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26954,6 +27378,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27014,6 +27439,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27059,6 +27485,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27176,6 +27603,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27236,6 +27664,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27281,6 +27710,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27398,6 +27828,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27458,6 +27889,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27513,6 +27945,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27630,6 +28063,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function-expression-name", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27690,6 +28124,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27705,6 +28140,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27816,6 +28252,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -27841,6 +28278,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27908,6 +28346,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -27972,6 +28411,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -27991,6 +28431,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28056,6 +28497,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -28163,6 +28605,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28178,6 +28621,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28243,6 +28687,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -28350,6 +28795,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28365,6 +28811,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28430,6 +28877,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -28537,6 +28985,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28552,6 +29001,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28619,6 +29069,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -28683,6 +29134,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -28702,6 +29154,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28792,6 +29245,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -28859,6 +29313,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28874,6 +29329,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28964,6 +29420,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29031,6 +29488,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -29046,6 +29504,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29180,6 +29639,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -29297,6 +29757,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -29312,6 +29773,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29373,6 +29835,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -29443,6 +29906,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29504,6 +29968,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -29574,6 +30039,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29635,6 +30101,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -29705,6 +30172,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29766,6 +30234,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -29836,6 +30305,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29897,6 +30367,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -29967,6 +30438,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30028,6 +30500,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30098,6 +30571,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30169,6 +30643,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30247,6 +30722,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -30307,6 +30783,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30378,6 +30855,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30484,6 +30962,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -30503,6 +30982,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30574,6 +31054,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30652,6 +31133,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30667,6 +31149,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30738,6 +31221,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30816,6 +31300,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30831,6 +31316,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30915,6 +31401,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30937,6 +31424,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31075,6 +31563,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31103,6 +31592,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31241,6 +31731,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31269,6 +31760,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31314,6 +31806,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31474,6 +31967,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -31534,6 +32028,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31672,6 +32167,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31700,6 +32196,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31784,6 +32281,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -31806,6 +32304,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31917,6 +32416,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -31942,6 +32442,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32053,6 +32554,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -32078,6 +32580,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32162,6 +32665,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -32184,6 +32688,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32319,6 +32824,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -32499,6 +33005,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32634,6 +33141,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -32814,6 +33322,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32923,6 +33432,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33050,6 +33560,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33133,6 +33644,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -33207,6 +33719,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33278,6 +33791,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33362,6 +33876,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33422,6 +33937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33477,6 +33993,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -33517,6 +34034,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -33557,6 +34075,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -33640,6 +34159,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -33671,6 +34191,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -33731,6 +34252,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -33791,6 +34313,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33826,6 +34349,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -33841,6 +34365,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33886,6 +34411,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -33917,6 +34443,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -33977,6 +34504,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34022,6 +34550,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -34056,6 +34585,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -34080,6 +34610,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -34095,6 +34626,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "switch", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -34119,6 +34651,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -34134,6 +34667,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -34149,6 +34683,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34184,6 +34719,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -34199,6 +34735,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34260,6 +34797,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -34330,6 +34868,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34365,6 +34904,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -34431,6 +34971,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34466,6 +35007,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -34481,6 +35023,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34526,6 +35069,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -34557,6 +35101,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -34617,6 +35162,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34682,6 +35228,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -34745,6 +35292,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34819,6 +35367,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -34854,6 +35403,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -34918,6 +35468,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34975,6 +35526,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -34994,6 +35546,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35039,6 +35592,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -35156,6 +35710,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -35216,6 +35771,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35345,6 +35901,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -35373,6 +35930,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35418,6 +35976,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -35492,6 +36051,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -35552,6 +36112,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35689,6 +36250,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -35869,6 +36431,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35980,6 +36543,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -36156,6 +36720,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36274,6 +36839,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -36503,6 +37069,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36548,6 +37115,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -36708,6 +37276,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36723,6 +37292,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36768,6 +37338,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -36954,6 +37525,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -37024,6 +37596,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37142,6 +37715,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -37371,6 +37945,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37489,6 +38064,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -37718,6 +38294,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37815,6 +38392,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -37840,6 +38418,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37958,6 +38537,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -38187,6 +38767,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38232,6 +38813,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38266,6 +38848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38281,6 +38864,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "catch", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38296,6 +38880,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38311,6 +38896,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38356,6 +38942,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38390,6 +38977,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38405,6 +38993,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "catch", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38429,6 +39018,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38444,6 +39034,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -38459,6 +39050,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38545,6 +39137,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38618,6 +39211,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38653,6 +39247,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -38668,6 +39263,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38713,6 +39309,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -38792,6 +39389,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -38868,6 +39466,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38913,6 +39512,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -39055,6 +39655,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -39190,6 +39791,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39245,6 +39847,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39326,6 +39929,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -39403,6 +40007,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -39422,6 +40027,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39557,6 +40163,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39585,6 +40192,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39640,6 +40248,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39721,6 +40330,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -39798,6 +40408,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -39817,6 +40428,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39862,6 +40474,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39905,6 +40518,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39924,6 +40538,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39993,6 +40608,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -40173,6 +40789,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -40414,6 +41031,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40459,6 +41077,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -40548,6 +41167,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -40675,6 +41295,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40720,6 +41341,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -40809,6 +41431,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -40936,6 +41559,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40983,6 +41607,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -41026,6 +41651,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -41045,6 +41671,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41202,6 +41829,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -41285,6 +41913,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -41307,6 +41936,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41417,6 +42047,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -41442,6 +42073,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41574,6 +42206,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -41654,6 +42287,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -41676,6 +42310,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41831,6 +42466,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -41914,6 +42550,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41959,6 +42596,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -42050,6 +42688,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -42075,6 +42714,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42197,6 +42837,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -42277,6 +42918,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42369,6 +43011,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -42443,6 +43086,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -42462,6 +43106,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42507,6 +43152,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -42596,6 +43242,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -42723,6 +43370,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42768,6 +43416,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -42857,6 +43506,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -42984,6 +43634,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43076,6 +43727,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -43150,6 +43802,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -43169,6 +43822,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43214,6 +43868,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -43358,6 +44013,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -43441,6 +44097,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43486,6 +44143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -43577,6 +44235,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -43602,6 +44261,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43669,6 +44329,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -43735,6 +44396,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -43812,6 +44474,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43915,6 +44578,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -43992,6 +44656,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44105,6 +44770,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -44182,6 +44848,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -44204,6 +44871,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44317,6 +44985,7 @@ Object { }, ], "type": "for", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -44394,6 +45063,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -44416,6 +45086,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44519,6 +45190,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -44691,6 +45363,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -44751,6 +45424,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44854,6 +45528,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -45026,6 +45701,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -45086,6 +45762,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45153,6 +45830,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -45188,6 +45866,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -45207,6 +45886,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45252,6 +45932,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -45283,6 +45964,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -45343,6 +46025,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45445,6 +46128,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -45533,6 +46217,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -45597,6 +46282,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -45661,6 +46347,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45706,6 +46393,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -45737,6 +46425,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -45752,6 +46441,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45797,6 +46487,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -45828,6 +46519,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -45888,6 +46580,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45955,6 +46648,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -45990,6 +46684,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -46054,6 +46749,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46121,6 +46817,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46156,6 +46853,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -46175,6 +46873,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46220,6 +46919,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46251,6 +46951,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46266,6 +46967,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46333,6 +47035,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46368,6 +47071,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -46387,6 +47091,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46432,6 +47137,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46463,6 +47169,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46478,6 +47185,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46535,6 +47243,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46554,6 +47263,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46589,6 +47299,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -46604,6 +47315,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46639,6 +47351,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -46654,6 +47367,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46691,6 +47405,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -46706,6 +47421,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46741,6 +47457,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -46756,6 +47473,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46791,6 +47509,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -46806,6 +47525,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46851,6 +47571,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -46866,6 +47587,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46881,6 +47603,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46926,6 +47649,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -46941,6 +47665,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46956,6 +47681,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47011,6 +47737,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47081,6 +47808,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47148,6 +47876,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47183,6 +47912,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -47247,6 +47977,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47344,6 +48075,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -47366,6 +48098,7 @@ Object { }, ], "type": "with", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -47408,6 +48141,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -47485,6 +48219,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47530,6 +48265,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47561,6 +48297,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47621,6 +48358,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47682,6 +48420,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47752,6 +48491,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47787,6 +48527,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47802,6 +48543,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47847,6 +48589,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47878,6 +48621,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47938,6 +48682,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47983,6 +48728,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -47998,6 +48744,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48013,6 +48760,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48048,6 +48796,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48063,6 +48812,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48108,6 +48858,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48139,6 +48890,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -48154,6 +48906,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48199,6 +48952,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -48259,6 +49013,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -48319,6 +49074,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48364,6 +49120,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -48395,6 +49152,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -48455,6 +49213,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48490,6 +49249,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48505,6 +49265,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48540,6 +49301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48555,6 +49317,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48612,6 +49375,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48631,6 +49395,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48666,6 +49431,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48681,6 +49447,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48716,6 +49483,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48731,6 +49499,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48766,6 +49535,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48781,6 +49551,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48816,6 +49587,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48831,6 +49603,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48866,6 +49639,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48881,6 +49655,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48916,6 +49691,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48931,6 +49707,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48966,6 +49743,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -48981,6 +49759,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49026,6 +49805,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49057,6 +49837,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -49117,6 +49898,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49178,6 +49960,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49248,6 +50031,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49305,6 +50089,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -49324,6 +50109,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49381,6 +50167,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -49400,6 +50187,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49477,6 +50265,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49499,6 +50288,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49544,6 +50334,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49604,6 +50395,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -49664,6 +50456,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49699,6 +50492,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -49714,6 +50508,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49771,6 +50566,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -49790,6 +50586,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49867,6 +50664,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49889,6 +50687,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49966,6 +50765,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49988,6 +50788,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50023,6 +50824,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50089,6 +50891,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50134,6 +50937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -50191,6 +50995,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -50261,6 +51066,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50322,6 +51128,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50392,6 +51199,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50427,6 +51235,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50493,6 +51302,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50528,6 +51338,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50643,6 +51454,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50678,6 +51490,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -50793,6 +51606,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50828,6 +51642,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50894,6 +51709,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50929,6 +51745,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -50995,6 +51812,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51030,6 +51848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -51045,6 +51864,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51080,6 +51900,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51146,6 +51967,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51181,6 +52003,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -51296,6 +52119,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51331,6 +52155,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -51346,6 +52171,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51381,6 +52207,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51447,6 +52274,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51482,6 +52310,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -51597,6 +52426,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51632,6 +52462,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -51747,6 +52578,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51782,6 +52614,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51848,6 +52681,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51883,6 +52717,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51949,6 +52784,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51984,6 +52820,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52050,6 +52887,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52095,6 +52933,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -52110,6 +52949,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52125,6 +52965,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52192,6 +53033,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52211,6 +53053,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52258,6 +53101,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52324,6 +53168,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52361,6 +53206,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -52376,6 +53222,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52451,6 +53298,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -52521,6 +53369,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52566,6 +53415,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -52623,6 +53473,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -52693,6 +53544,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52764,6 +53616,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -52848,6 +53701,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -52908,6 +53762,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52985,6 +53840,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -53007,6 +53863,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53089,6 +53946,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -53163,6 +54021,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53220,6 +54079,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -53239,6 +54099,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53284,6 +54145,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -53324,6 +54186,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -53440,6 +54303,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -53462,6 +54326,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53544,6 +54409,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -53618,6 +54484,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53720,6 +54587,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -53797,6 +54665,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53858,6 +54727,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -53877,6 +54747,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53912,6 +54783,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -53927,6 +54799,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -53972,6 +54845,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -54025,6 +54899,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -54044,6 +54919,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54168,6 +55044,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -54297,6 +55174,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54421,6 +55299,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -54550,6 +55429,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54611,6 +55491,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -54681,6 +55562,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54742,6 +55624,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -54812,6 +55695,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -54881,6 +55765,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -54942,6 +55827,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -55016,6 +55902,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55061,6 +55948,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55120,6 +56008,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -55139,6 +56028,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55184,6 +56074,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55243,6 +56134,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -55262,6 +56154,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55307,6 +56200,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55366,6 +56260,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -55385,6 +56280,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55430,6 +56326,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -55532,6 +56429,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -55551,6 +56449,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55596,6 +56495,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -55655,6 +56555,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -55674,6 +56575,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55741,6 +56643,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -55802,6 +56705,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -55876,6 +56780,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -55994,6 +56899,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -56223,6 +57129,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56260,6 +57167,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -56275,6 +57183,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56310,6 +57219,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -56325,6 +57235,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56360,6 +57271,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -56375,6 +57287,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56410,6 +57323,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -56425,6 +57339,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56486,6 +57401,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56556,6 +57472,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56617,6 +57534,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56687,6 +57605,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56748,6 +57667,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56818,6 +57738,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -56879,6 +57800,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -56949,6 +57871,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57010,6 +57933,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -57080,6 +58004,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57125,6 +58050,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -57242,6 +58168,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -57302,6 +58229,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57357,6 +58285,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -57431,6 +58360,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -57491,6 +58421,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -57551,6 +58482,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57606,6 +58538,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -57680,6 +58613,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -57740,6 +58674,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -57800,6 +58735,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -57845,6 +58781,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -57948,6 +58885,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58008,6 +58946,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58053,6 +58992,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58199,6 +59139,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -58259,6 +59200,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58304,6 +59246,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58404,6 +59347,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -58474,6 +59418,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58519,6 +59464,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -58662,6 +59608,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -58732,6 +59679,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58777,6 +59725,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -58851,6 +59800,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -58911,6 +59861,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -58956,6 +59907,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -59030,6 +59982,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -59090,6 +60043,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59151,6 +60105,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -59221,6 +60176,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59282,6 +60238,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -59352,6 +60309,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59413,6 +60371,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -59483,6 +60442,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59544,6 +60504,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -59614,6 +60575,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59675,6 +60637,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -59745,6 +60708,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59806,6 +60770,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -59876,6 +60841,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -59959,6 +60925,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -60033,6 +61000,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60333,6 +61301,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -60379,6 +61348,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60480,6 +61450,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -60505,6 +61476,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60602,6 +61574,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -60627,6 +61600,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60704,6 +61678,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60726,6 +61701,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60783,6 +61759,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -60802,6 +61779,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60837,6 +61815,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -60852,6 +61831,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -60913,6 +61893,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -60983,6 +61964,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61107,6 +62089,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -61236,6 +62219,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61271,6 +62255,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -61286,6 +62271,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61321,6 +62307,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -61336,6 +62323,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61397,6 +62385,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -61467,6 +62456,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61524,6 +62514,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -61543,6 +62534,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61629,6 +62621,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -61728,6 +62721,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -61802,6 +62796,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61837,6 +62832,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -61852,6 +62848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -61887,6 +62884,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -61902,6 +62900,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 28b6d8b71455..e729ace843f6 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 384bedec44cc..898569ddcf93 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 { @@ -86,6 +88,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -153,6 +156,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -231,6 +235,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Props": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 10, }, @@ -238,9 +247,6 @@ Object { "App": Object { "$ref": 2, }, - "Props": Object { - "$ref": 1, - }, "React": Object { "$ref": 0, }, @@ -387,6 +393,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 d31981c178a3..47d641042c7a 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 { @@ -1106,6 +1126,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1170,6 +1191,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -1234,6 +1256,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1279,6 +1302,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -1294,14 +1318,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, }, @@ -1354,6 +1379,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1419,6 +1445,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1483,6 +1510,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1498,6 +1526,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1601,13 +1630,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, }, @@ -1715,6 +1746,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -1730,6 +1762,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1785,6 +1818,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1816,6 +1850,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function-expression-name", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1876,6 +1911,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -1891,6 +1927,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2012,6 +2049,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -2202,6 +2240,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -2262,6 +2301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2349,6 +2389,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2371,14 +2412,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, }, @@ -2438,6 +2480,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2525,14 +2568,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, }, @@ -2619,14 +2663,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, }, @@ -2686,6 +2731,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2763,6 +2809,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2785,6 +2832,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2862,6 +2910,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2884,6 +2933,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2941,6 +2991,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -2960,6 +3011,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3017,6 +3069,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -3036,6 +3089,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3118,6 +3172,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3192,6 +3247,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3237,6 +3293,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3319,6 +3376,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -3383,6 +3441,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3428,6 +3487,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -3510,6 +3570,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -3574,6 +3635,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3629,6 +3691,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3689,6 +3752,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3767,6 +3831,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -3827,6 +3892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -3887,6 +3953,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3942,6 +4009,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3982,6 +4050,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4013,6 +4082,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4073,6 +4143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4133,6 +4204,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4188,6 +4260,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4228,6 +4301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4259,6 +4333,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4319,6 +4394,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -4379,6 +4455,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4434,13 +4511,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, }, @@ -4517,13 +4596,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, }, @@ -4591,6 +4672,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -4651,6 +4733,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -4711,6 +4794,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4756,6 +4840,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -4816,6 +4901,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -4876,6 +4962,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4931,6 +5018,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -5005,6 +5093,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -5065,6 +5154,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -5125,6 +5215,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5167,15 +5258,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 { @@ -5183,7 +5297,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -5233,23 +5347,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 [ @@ -5268,10 +5365,11 @@ Object { "$ref": 1, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -5335,10 +5433,11 @@ Object { "$ref": 1, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5381,15 +5480,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 { @@ -5397,7 +5523,7 @@ Object { }, "variables": Array [ Object { - "$id": 4, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -5436,6 +5562,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, + }, + }, ], }, ], @@ -5443,24 +5609,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, }, @@ -5479,22 +5628,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 { @@ -5503,46 +5650,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 { @@ -5589,13 +5696,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 { @@ -5638,15 +5746,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 { @@ -5654,7 +5829,7 @@ Object { }, "variables": Array [ Object { - "$id": 6, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -5693,6 +5868,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, + }, + }, ], }, ], @@ -5700,58 +5915,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, }, @@ -5770,10 +5934,7 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "$ref": 1, }, Object { "$ref": 4, @@ -5781,17 +5942,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 { @@ -5800,46 +5962,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 { @@ -5886,10 +6008,7 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 3, + "$ref": 1, }, Object { "$ref": 4, @@ -5897,8 +6016,12 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -5954,13 +6077,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, }, @@ -6028,6 +6153,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -6088,6 +6214,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -6148,6 +6275,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6225,13 +6353,15 @@ Object { }, ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 3, - }, "arguments": Object { "$ref": 2, }, @@ -6303,6 +6433,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -6367,6 +6498,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -6431,6 +6563,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6473,15 +6606,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 { @@ -6489,7 +6645,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -6533,31 +6689,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, }, @@ -6618,10 +6757,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6664,15 +6804,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 { @@ -6680,7 +6843,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { @@ -6730,23 +6893,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 [ @@ -6765,10 +6911,11 @@ Object { "$ref": 1, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -6832,10 +6979,11 @@ Object { "$ref": 1, }, Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6878,15 +7026,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 { @@ -6894,7 +7085,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -6938,51 +7129,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, }, @@ -7043,13 +7200,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 { @@ -7092,15 +7250,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 { @@ -7108,7 +7329,7 @@ Object { }, "variables": Array [ Object { - "$id": 4, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -7152,71 +7373,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, }, @@ -7276,17 +7446,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 { @@ -7342,6 +7513,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -7382,13 +7554,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, }, @@ -7465,6 +7639,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -7496,6 +7671,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -7556,6 +7732,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -7616,6 +7793,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7647,7 +7825,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 15, + "$id": 14, "block": Object { "range": Array [ 0, @@ -7657,7 +7835,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 13, "block": Object { "range": Array [ 60, @@ -7671,12 +7849,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 [], }, @@ -7685,9 +7864,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 11, + "$id": 10, "from": Object { - "$ref": 15, + "$ref": 14, }, "identifier": Object { "name": "Constructor", @@ -7704,9 +7883,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 12, + "$id": 11, "from": Object { - "$ref": 15, + "$ref": 14, }, "identifier": Object { "name": "T", @@ -7718,14 +7897,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", @@ -7737,48 +7916,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 { @@ -7814,15 +7995,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 { @@ -7858,11 +8039,11 @@ Object { "name": "Base", "references": Array [ Object { - "$ref": 13, + "$ref": 12, }, ], "scope": Object { - "$ref": 15, + "$ref": 14, }, }, ], @@ -7879,15 +8060,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 { @@ -7895,7 +8101,7 @@ Object { }, "variables": Array [ Object { - "$id": 16, + "$id": 15, "defs": Array [ Object { "name": Object { @@ -7951,6 +8157,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 25, }, @@ -8020,6 +8227,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 25, }, @@ -8085,14 +8293,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, }, @@ -8152,25 +8361,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 [ @@ -8186,7 +8376,7 @@ Object { "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 6, "from": Object { "$ref": 25, }, @@ -8211,6 +8401,14 @@ Object { }, ], "type": "module", + "typeMap": Object { + "Constructor": Object { + "$ref": 4, + }, + "I": Object { + "$ref": 3, + }, + }, "upperScope": Object { "$ref": 26, }, @@ -8218,12 +8416,6 @@ Object { "C": Object { "$ref": 2, }, - "Constructor": Object { - "$ref": 4, - }, - "I": Object { - "$ref": 3, - }, "M": Object { "$ref": 0, }, @@ -8272,7 +8464,7 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 6, + "$ref": 5, }, ], "scope": Object { @@ -8356,7 +8548,7 @@ Object { "name": "C", "references": Array [ Object { - "$ref": 7, + "$ref": 6, }, ], "scope": Object { @@ -8400,7 +8592,7 @@ Object { "name": "I", "references": Array [ Object { - "$ref": 5, + "$ref": 16, }, ], "scope": Object { @@ -8444,7 +8636,7 @@ Object { "name": "Constructor", "references": Array [ Object { - "$ref": 11, + "$ref": 10, }, ], "scope": Object { @@ -8463,6 +8655,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8571,6 +8764,11 @@ Object { }, ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { "$ref": 8, }, @@ -8578,9 +8776,6 @@ Object { "Base": Object { "$ref": 3, }, - "T": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -8696,6 +8891,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -8764,6 +8960,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8831,6 +9028,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -8895,6 +9093,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -8959,6 +9158,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9004,6 +9204,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -9064,6 +9265,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9124,6 +9326,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9169,6 +9372,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -9229,6 +9433,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9289,6 +9494,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9356,6 +9562,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9420,6 +9627,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -9484,6 +9692,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9590,6 +9799,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -9801,6 +10011,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -9861,6 +10072,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -9921,6 +10133,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9976,6 +10189,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -10022,6 +10236,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -10041,6 +10256,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -10105,6 +10321,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -10169,6 +10386,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10236,6 +10454,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -10300,6 +10519,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -10364,6 +10584,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10470,6 +10691,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -10681,6 +10903,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -10741,6 +10964,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -10801,6 +11025,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10907,6 +11132,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -11118,6 +11344,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -11178,6 +11405,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -11238,6 +11466,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11319,6 +11548,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11440,6 +11670,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -11500,6 +11731,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -11560,6 +11792,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11605,6 +11838,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -11665,6 +11899,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -11725,6 +11960,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11780,6 +12016,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11854,6 +12091,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11914,6 +12152,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -11974,6 +12213,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12029,13 +12269,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, }, @@ -12112,13 +12354,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, }, @@ -12186,6 +12430,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -12246,6 +12491,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -12306,6 +12552,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12351,12 +12598,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 { @@ -12364,7 +12616,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -12403,6 +12655,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, + }, + }, ], }, ], @@ -12411,14 +12703,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -12428,46 +12718,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 { @@ -12514,6 +12764,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12556,15 +12807,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 { @@ -12572,7 +12850,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -12611,44 +12889,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, }, }, @@ -12658,46 +12956,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 { @@ -12744,10 +13002,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12793,12 +13052,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 { @@ -12806,7 +13070,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -12845,6 +13109,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, + }, + }, ], }, ], @@ -12853,14 +13157,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { "A": Object { - "$ref": 1, - }, - "__P": Object { "$ref": 0, }, }, @@ -12870,46 +13172,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 { @@ -12956,6 +13218,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13027,6 +13290,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -13134,6 +13398,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -13194,6 +13459,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13239,6 +13505,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -13299,6 +13566,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13359,6 +13627,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13404,6 +13673,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -13464,6 +13734,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13524,6 +13795,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13634,6 +13906,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -13659,6 +13932,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13956,6 +14230,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -14002,6 +14277,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14112,6 +14388,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -14137,6 +14414,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14255,6 +14533,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -14340,6 +14619,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -14404,6 +14684,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14479,6 +14760,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -14494,6 +14776,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14607,6 +14890,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14682,6 +14966,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -14697,6 +14982,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14810,6 +15096,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14867,6 +15154,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -14886,6 +15174,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14943,6 +15232,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -14962,6 +15252,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15033,6 +15324,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15140,6 +15432,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15200,6 +15493,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15271,6 +15565,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15378,6 +15673,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15438,6 +15734,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15483,6 +15780,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 0, + }, + }, "upperScope": Object { "$ref": 2, }, @@ -15490,7 +15792,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, @@ -15498,59 +15841,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, @@ -15558,6 +15857,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15603,6 +15903,14 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 0, + }, + "U": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 3, }, @@ -15610,7 +15918,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, @@ -15618,102 +16007,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, @@ -15721,6 +16023,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15766,12 +16069,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 { @@ -15779,7 +16087,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -15818,6 +16126,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, + }, + }, ], }, ], @@ -15826,14 +16174,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -15843,46 +16189,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 { @@ -15929,6 +16235,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15974,12 +16281,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 { @@ -15987,7 +16302,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -16026,6 +16341,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, + }, + }, ], }, ], @@ -16034,19 +16429,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, @@ -16054,86 +16444,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 { @@ -16180,6 +16490,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16251,6 +16562,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16358,6 +16670,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -16418,6 +16731,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16463,6 +16777,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16478,14 +16793,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, }, @@ -16538,6 +16854,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16583,6 +16900,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16598,14 +16916,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, }, @@ -16658,6 +16977,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16725,6 +17045,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -16744,14 +17065,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, }, @@ -16808,6 +17130,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16873,13 +17196,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, }, @@ -17020,6 +17345,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -17090,6 +17416,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17135,6 +17462,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -17192,6 +17520,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17262,6 +17591,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17307,6 +17637,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -17376,6 +17707,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -17465,6 +17797,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -17543,6 +17876,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -17603,6 +17937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17668,6 +18003,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17746,6 +18082,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -17806,6 +18143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -17851,6 +18189,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -17968,6 +18307,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -18028,6 +18368,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18073,6 +18414,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -18190,6 +18532,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -18250,6 +18593,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18353,13 +18697,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, }, @@ -18481,6 +18827,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -18541,6 +18888,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18586,13 +18934,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, }, @@ -18660,6 +19010,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -18720,6 +19071,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18823,13 +19175,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, }, @@ -18951,6 +19305,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -19011,6 +19366,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19076,6 +19432,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -19154,6 +19511,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -19214,6 +19572,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19325,6 +19684,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -19497,6 +19857,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -19561,6 +19922,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19596,6 +19958,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -19656,6 +20019,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19691,6 +20055,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -19751,6 +20116,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19796,6 +20162,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -19862,6 +20229,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -19884,10 +20252,7 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { + "typeMap": Object { "A": Object { "$ref": 0, }, @@ -19895,6 +20260,10 @@ Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 6, }, @@ -19994,6 +20363,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20081,6 +20451,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -20103,14 +20474,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, }, @@ -20170,6 +20542,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20237,6 +20610,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -20256,14 +20630,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, }, @@ -20320,6 +20695,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20407,6 +20783,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -20429,14 +20806,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, }, @@ -20496,6 +20874,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20541,6 +20920,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -20556,10 +20936,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 1, }, @@ -20567,6 +20944,10 @@ Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -20659,6 +21040,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21026,10 +21408,7 @@ Object { }, ], "type": "interface", - "upperScope": Object { - "$ref": 20, - }, - "variableMap": Object { + "typeMap": Object { "F": Object { "$ref": 2, }, @@ -21037,6 +21416,10 @@ Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 20, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 20, }, @@ -21178,14 +21561,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, }, @@ -21287,6 +21671,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21374,6 +21759,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -21396,14 +21782,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, }, @@ -21463,6 +21850,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21530,6 +21918,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -21549,14 +21938,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, }, @@ -21613,6 +22003,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21700,6 +22091,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -21722,10 +22114,7 @@ Object { }, ], "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "typeMap": Object { "Foo": Object { "$ref": 1, }, @@ -21733,6 +22122,10 @@ Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 5, }, @@ -21832,6 +22225,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -21877,6 +22271,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -21892,10 +22287,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { + "typeMap": Object { "T": Object { "$ref": 0, }, @@ -21903,6 +22295,10 @@ Object { "$ref": 1, }, }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, @@ -21995,6 +22391,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22062,6 +22459,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -22081,14 +22479,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, }, @@ -22145,6 +22544,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22270,14 +22670,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, }, @@ -22344,14 +22745,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, }, @@ -22411,6 +22813,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22518,6 +22921,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -22543,14 +22947,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, }, @@ -22613,6 +23018,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22658,6 +23064,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -22673,14 +23080,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, }, @@ -22733,6 +23141,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22800,6 +23209,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -22819,14 +23229,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, }, @@ -22883,6 +23294,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22980,6 +23392,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -23056,6 +23469,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23133,6 +23547,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -23206,6 +23621,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23356,6 +23772,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -23497,6 +23914,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -23564,6 +23982,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23599,6 +24018,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -23714,6 +24134,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23759,6 +24180,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -23799,6 +24221,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -23859,6 +24282,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -23919,6 +24343,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23964,13 +24389,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, }, @@ -24047,13 +24474,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, }, @@ -24130,6 +24559,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -24170,6 +24600,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -24270,6 +24701,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -24340,6 +24772,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24375,6 +24808,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -24390,6 +24824,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24457,6 +24892,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -24535,6 +24971,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -24599,6 +25036,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24705,14 +25143,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, }, @@ -24776,14 +25215,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, }, @@ -24843,6 +25283,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24949,14 +25390,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, }, @@ -25020,14 +25462,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, }, @@ -25087,6 +25530,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25132,6 +25576,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -25147,14 +25592,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, }, @@ -25207,6 +25653,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25268,6 +25715,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -25338,6 +25786,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25403,6 +25852,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25493,6 +25943,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25563,6 +26014,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25647,6 +26099,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25740,6 +26193,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -25810,6 +26264,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25894,6 +26349,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25975,6 +26431,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -26035,6 +26492,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26122,6 +26580,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -26144,14 +26603,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, }, @@ -26211,6 +26671,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26290,6 +26751,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -26354,6 +26816,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -26369,6 +26832,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -26436,6 +26900,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -26496,6 +26961,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26541,13 +27007,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, }, @@ -26646,13 +27114,15 @@ Object { }, ], "type": "function", + "typeMap": Object { + "A": Object { + "$ref": 8, + }, + }, "upperScope": Object { "$ref": 11, }, "variableMap": Object { - "A": Object { - "$ref": 8, - }, "arguments": Object { "$ref": 7, }, @@ -26765,6 +27235,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -26878,6 +27349,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26889,7 +27361,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 20, + "$id": 22, "block": Object { "range": Array [ 0, @@ -26899,7 +27371,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 19, + "$id": 21, "block": Object { "range": Array [ 0, @@ -26920,23 +27392,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 { @@ -26975,10 +27472,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, @@ -26989,11 +27530,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 { @@ -27001,7 +27567,7 @@ Object { }, }, "variableScope": Object { - "$ref": 19, + "$ref": 21, }, "variables": Array [ Object { @@ -27041,13 +27607,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, @@ -27060,9 +27670,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 13, + "$id": 15, "from": Object { - "$ref": 15, + "$ref": 17, }, "identifier": Object { "name": "bar2", @@ -27079,9 +27689,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 16, "from": Object { - "$ref": 15, + "$ref": 17, }, "identifier": Object { "name": "A", @@ -27093,31 +27703,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, @@ -27130,9 +27741,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 16, + "$id": 18, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { "name": "bar", @@ -27149,9 +27760,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 19, "from": Object { - "$ref": 18, + "$ref": 20, }, "identifier": Object { "name": "A", @@ -27163,26 +27774,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 [], }, @@ -27193,26 +27805,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", @@ -27223,34 +27816,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", @@ -27261,20 +27833,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, @@ -27282,15 +27856,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 { @@ -27298,42 +27877,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", @@ -27375,22 +27996,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 [ @@ -27411,100 +28016,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 { @@ -27544,17 +28063,11 @@ Object { "name": "bar", "references": Array [ Object { - "$ref": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 16, + "$ref": 18, }, ], "scope": Object { - "$ref": 19, + "$ref": 21, }, }, Object { @@ -27594,11 +28107,11 @@ Object { "name": "bar2", "references": Array [ Object { - "$ref": 13, + "$ref": 15, }, ], "scope": Object { - "$ref": 19, + "$ref": 21, }, }, ], @@ -27607,12 +28120,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 [], } @@ -27676,6 +28197,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -27740,6 +28262,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -27804,6 +28327,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27849,6 +28373,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -27864,254 +28389,138 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "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, - 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-boolean.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": "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, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 17, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 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, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "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-boolean.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", + "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, }, @@ -28131,7 +28540,7 @@ Object { "node": Object { "range": Array [ 0, - 16, + 18, ], "type": "TSTypeAliasDeclaration", }, @@ -28164,6 +28573,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28173,7 +28583,7 @@ Object { } `; -exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { "$id": 3, "block": Object { @@ -28209,6 +28619,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -28224,14 +28635,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, + 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, + "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-never.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -28284,6 +28819,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28329,6 +28865,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -28344,14 +28881,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, }, @@ -28404,6 +28942,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28449,6 +28988,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -28464,14 +29004,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, }, @@ -28524,6 +29065,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28569,6 +29111,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -28584,14 +29127,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, }, @@ -28644,6 +29188,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28689,6 +29234,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -28704,14 +29250,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, }, @@ -28764,6 +29311,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28809,6 +29357,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -28824,14 +29373,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, }, @@ -28884,6 +29434,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28929,6 +29480,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -28944,14 +29496,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, }, @@ -29004,6 +29557,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29049,6 +29603,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -29064,14 +29619,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, }, @@ -29124,6 +29680,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29169,6 +29726,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -29184,14 +29742,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, }, @@ -29244,6 +29803,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29289,6 +29849,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -29304,14 +29865,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, }, @@ -29364,6 +29926,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29489,14 +30052,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, }, @@ -29563,14 +30127,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, }, @@ -29630,6 +30195,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29757,6 +30323,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -29785,14 +30352,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, }, @@ -29858,6 +30426,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29903,6 +30472,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -29918,14 +30488,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, }, @@ -29978,6 +30549,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30013,6 +30585,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -30079,6 +30652,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30114,6 +30688,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30278,6 +30853,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30335,6 +30911,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30405,6 +30982,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30491,6 +31069,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30614,6 +31193,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30649,6 +31229,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -30715,6 +31296,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30760,6 +31342,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30820,6 +31403,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30880,6 +31464,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30925,6 +31510,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30985,6 +31571,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -31045,6 +31632,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31090,6 +31678,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -31193,6 +31782,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31253,6 +31843,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31298,6 +31889,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31313,6 +31905,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -31373,6 +31966,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31418,6 +32012,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31433,14 +32028,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, }, @@ -31493,6 +32089,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31538,6 +32135,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31553,6 +32151,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -31613,6 +32212,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31658,6 +32258,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31673,6 +32274,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -31733,6 +32335,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31778,6 +32381,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31793,14 +32397,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, }, @@ -31853,6 +32458,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31888,6 +32494,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31954,6 +32561,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32009,6 +32617,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32062,6 +32671,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32126,6 +32736,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -32190,6 +32801,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32245,6 +32857,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32298,6 +32911,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32362,6 +32976,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -32426,6 +33041,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32481,6 +33097,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -32534,6 +33151,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -32598,6 +33216,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -32662,6 +33281,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32737,6 +33357,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -32837,6 +33458,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -32901,6 +33523,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -32965,6 +33588,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33010,6 +33634,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -33092,6 +33717,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33156,6 +33782,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33201,6 +33828,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -33283,6 +33911,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33347,6 +33976,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33402,6 +34032,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33455,6 +34086,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33519,6 +34151,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33583,6 +34216,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33638,6 +34272,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33691,6 +34326,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33755,6 +34391,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -33819,6 +34456,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33874,6 +34512,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -33927,6 +34566,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -33991,6 +34631,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34055,6 +34696,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34110,6 +34752,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -34163,6 +34806,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -34227,6 +34871,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34291,6 +34936,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34368,6 +35014,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -34446,6 +35093,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -34510,6 +35158,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -34574,6 +35223,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -34710,6 +35360,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -34798,6 +35449,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -34868,6 +35520,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -34938,6 +35591,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35015,6 +35669,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -35093,6 +35748,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -35157,6 +35813,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -35221,6 +35878,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35298,6 +35956,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -35376,6 +36035,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -35440,6 +36100,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -35504,6 +36165,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35600,6 +36262,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -35682,6 +36345,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -35746,6 +36410,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -35810,6 +36475,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35906,6 +36572,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -35988,6 +36655,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -36052,6 +36720,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -36116,6 +36785,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36193,6 +36863,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36271,6 +36942,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -36335,6 +37007,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -36399,6 +37072,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36476,6 +37150,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36554,6 +37229,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -36618,6 +37294,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -36682,6 +37359,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36789,6 +37467,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -36859,6 +37538,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -36929,6 +37609,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37016,6 +37697,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -37083,6 +37765,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -37150,6 +37833,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37237,6 +37921,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -37304,6 +37989,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -37371,6 +38057,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37458,6 +38145,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -37525,6 +38213,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -37592,6 +38281,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37637,6 +38327,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -37697,6 +38388,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -37757,6 +38449,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37799,15 +38492,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 { @@ -37815,7 +38531,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -37859,31 +38575,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, }, @@ -37944,10 +38643,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37993,6 +38693,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38075,6 +38776,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -38139,6 +38841,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38181,15 +38884,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 { @@ -38197,7 +38923,7 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -38241,31 +38967,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, }, @@ -38326,10 +39035,11 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38375,6 +39085,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38390,6 +39101,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38450,6 +39162,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38495,6 +39208,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38526,6 +39240,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -38586,6 +39301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38631,6 +39347,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38646,14 +39363,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, }, @@ -38706,6 +39424,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38767,6 +39486,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38837,6 +39557,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38894,6 +39615,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -38964,6 +39686,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39021,6 +39744,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39040,6 +39764,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39097,6 +39822,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39116,6 +39842,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39161,6 +39888,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39192,6 +39920,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39252,6 +39981,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39297,6 +40027,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39328,6 +40059,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39388,6 +40120,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39443,6 +40176,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39474,6 +40208,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39534,6 +40269,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -39594,6 +40330,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39639,6 +40376,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39696,6 +40434,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39766,6 +40505,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39821,6 +40561,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -39852,6 +40593,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39912,6 +40654,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -39972,6 +40715,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40017,6 +40761,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40032,14 +40777,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, }, @@ -40092,6 +40838,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40137,6 +40884,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40152,6 +40900,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -40212,6 +40961,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40257,6 +41007,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40272,14 +41023,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, }, @@ -40332,6 +41084,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40377,6 +41130,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40392,14 +41146,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, }, @@ -40452,6 +41207,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40497,6 +41253,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40512,14 +41269,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, }, @@ -40572,6 +41330,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40617,6 +41376,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40632,14 +41392,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, }, @@ -40692,6 +41453,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40737,6 +41499,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40752,14 +41515,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, }, @@ -40812,6 +41576,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40857,6 +41622,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40872,14 +41638,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, }, @@ -40932,6 +41699,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -40977,6 +41745,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -40992,14 +41761,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, }, @@ -41052,6 +41822,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41097,6 +41868,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -41112,14 +41884,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, }, @@ -41172,6 +41945,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41239,6 +42013,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -41258,14 +42033,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, }, @@ -41322,6 +42098,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41389,6 +42166,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -41408,14 +42186,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, }, @@ -41472,6 +42251,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41539,6 +42319,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -41558,14 +42339,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, }, @@ -41622,6 +42404,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41689,6 +42472,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -41708,14 +42492,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, }, @@ -41772,6 +42557,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -41839,6 +42625,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -41858,14 +42645,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, }, @@ -41922,6 +42710,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42009,6 +42798,7 @@ Object { }, ], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -42031,14 +42821,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, }, @@ -42098,6 +42889,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42143,6 +42935,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42158,14 +42951,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, }, @@ -42218,6 +43012,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42263,6 +43058,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42278,14 +43074,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, }, @@ -42338,6 +43135,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42383,6 +43181,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42398,14 +43197,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, }, @@ -42458,6 +43258,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42503,6 +43304,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42518,14 +43320,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, }, @@ -42578,6 +43381,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42623,6 +43427,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42638,14 +43443,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, }, @@ -42698,6 +43504,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42743,6 +43550,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42758,14 +43566,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, }, @@ -42818,6 +43627,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42883,6 +43693,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42902,6 +43713,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -42965,6 +43777,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -42984,6 +43797,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43019,6 +43833,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -43034,6 +43849,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43131,6 +43947,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -43156,6 +43973,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43258,6 +44076,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -43335,6 +44154,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43412,6 +44232,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -43434,6 +44255,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43479,6 +44301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -43545,6 +44368,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -43560,6 +44384,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43637,6 +44462,7 @@ Object { }, ], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -43701,6 +44527,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -43765,6 +44592,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -43829,6 +44657,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -43864,6 +44693,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -43888,6 +44718,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -43912,6 +44743,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -43927,6 +44759,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "global": Object { @@ -44088,6 +44921,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -44119,6 +44953,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -44192,6 +45027,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -44223,6 +45059,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -44326,6 +45163,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -44341,6 +45179,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44406,6 +45245,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -44523,6 +45363,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 14, }, @@ -44602,6 +45443,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 13, }, @@ -44617,14 +45459,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, }, @@ -44707,6 +45550,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 15, }, @@ -44810,6 +45654,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 16, }, @@ -44923,6 +45768,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -44958,6 +45804,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -44973,6 +45820,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45018,6 +45866,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -45033,14 +45882,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, }, @@ -45093,6 +45943,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45128,6 +45979,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -45194,6 +46046,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45319,14 +46172,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, }, @@ -45393,14 +46247,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, }, @@ -45460,6 +46315,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -45723,14 +46579,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, }, @@ -45818,14 +46675,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, }, @@ -45900,6 +46758,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46026,14 +46885,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, }, @@ -46100,14 +46960,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, }, @@ -46170,6 +47031,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46205,6 +47067,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -46271,6 +47134,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46348,6 +47212,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -46421,6 +47286,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46516,13 +47382,15 @@ Object { }, ], "type": "module", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 1, - }, "f": Object { "$ref": 0, }, @@ -46636,6 +47504,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46693,6 +47562,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46763,6 +47633,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46820,6 +47691,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -46890,6 +47762,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -46967,6 +47840,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -47040,6 +47914,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47135,13 +48010,15 @@ Object { }, ], "type": "module", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "T": Object { - "$ref": 1, - }, "f": Object { "$ref": 0, }, @@ -47255,6 +48132,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47312,6 +48190,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47382,6 +48261,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47449,6 +48329,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47468,14 +48349,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, }, @@ -47532,6 +48414,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47599,6 +48482,7 @@ Object { }, ], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47618,14 +48502,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, }, @@ -47682,6 +48567,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47739,6 +48625,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47809,6 +48696,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47866,6 +48754,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -47936,6 +48825,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -47981,6 +48871,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -47996,14 +48887,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, }, @@ -48056,6 +48948,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48101,6 +48994,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48116,14 +49010,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, }, @@ -48176,6 +49071,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48221,6 +49117,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48236,14 +49133,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, }, @@ -48296,6 +49194,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48373,6 +49272,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -48446,6 +49346,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48553,14 +49454,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, }, @@ -48620,14 +49522,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, }, @@ -48684,6 +49587,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48719,6 +49623,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48785,6 +49690,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48820,6 +49726,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48886,6 +49793,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -48921,6 +49829,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -48987,6 +49896,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49044,6 +49954,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49114,6 +50025,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49171,6 +50083,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49241,6 +50154,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49298,6 +50212,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49368,6 +50283,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49425,6 +50341,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49495,6 +50412,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49540,6 +50458,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -49555,14 +50474,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, }, @@ -49615,6 +50535,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49660,6 +50581,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -49675,14 +50597,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, }, @@ -49735,6 +50658,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49792,6 +50716,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49862,6 +50787,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -49919,6 +50845,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -49989,6 +50916,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50066,6 +50994,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -50139,6 +51068,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50194,6 +51124,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -50225,6 +51156,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -50285,6 +51217,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -50345,6 +51278,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -50400,6 +51334,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -50464,6 +51399,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -50514,6 +51450,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -50574,6 +51511,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -50680,6 +51618,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 19, }, @@ -50763,6 +51702,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -50883,6 +51823,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -50947,6 +51888,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 26, }, @@ -50978,6 +51920,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 27, }, @@ -51051,6 +51994,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 28, }, @@ -51111,6 +52055,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51146,6 +52091,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51212,6 +52158,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51247,6 +52194,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51313,6 +52261,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51348,6 +52297,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51414,6 +52364,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51449,6 +52400,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51515,6 +52467,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51560,6 +52513,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51575,14 +52529,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, }, @@ -51635,6 +52590,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51670,6 +52626,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -51736,6 +52693,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51793,6 +52751,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -51912,6 +52871,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -51969,6 +52929,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -52039,6 +53000,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52074,6 +53036,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -52287,6 +53250,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -52332,6 +53296,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -52347,14 +53312,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, }, @@ -52407,6 +53373,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 ecd36e6f2365..9ef9b994f58f 100644 --- a/packages/parser/tests/tools/scope-analysis.ts +++ b/packages/parser/tests/tools/scope-analysis.ts @@ -128,6 +128,13 @@ export function scopeToJSON( }, {} ); + const typeMap = Array.from(scope.setTypes.entries()).reduce( + (map: any, [name, variable]: any) => { + 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); @@ -143,6 +150,7 @@ export function scopeToJSON( variables, references, variableMap, + typeMap, throughReferences, variableScope, upperScope, From b542328b883d21cb87b8dda84771975f78d1faa0 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 23:52:22 +0100 Subject: [PATCH 10/12] fix(parser): fix scopes --- .../tests/rules/no-unused-vars.test.ts | 13 +- packages/parser/src/scope/scopes.ts | 260 ++++++++---------- .../lib/__snapshots__/scope-analysis.ts.snap | 139 +++++----- .../lib/__snapshots__/typescript.ts.snap | 66 +++-- 4 files changed, 236 insertions(+), 242 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 6a30eb332e75..a06137bf8a0b 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -988,9 +988,9 @@ new test(); `, errors: error([ { - message: "'foo' is defined but never used.", - line: 3, - column: 10 + message: "'foo' is assigned a value but never used.", + line: 2, + column: 7 } ]) }, @@ -1007,7 +1007,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 }, @@ -1015,6 +1015,11 @@ class bar {}; message: "'bar' is defined but never used.", 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 570334499ea2..2f5cc19ceee1 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -5,45 +5,87 @@ import { Reference } from 'eslint-scope'; import { Definition } from 'eslint-scope/lib/definition'; import Variable from 'eslint-scope/lib/variable'; -export class Scope extends esScope.Scope { - setTypes: Map = new Map(); - types: Variable[] = []; +function defineType(this: any, node: TSESTree.Node, def: Definition) { + if (node && node.type === AST_NODE_TYPES.Identifier) { + this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); + } +} - /** @internal */ - __defineType(node: TSESTree.Node, def: Definition) { - if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); - } +function resolveType(this: any, ref: Reference) { + const name = ref.identifier.name; + + if (!this.setTypes.has(name)) { + return false; + } + const variable: 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: Reference) { - const name = ref.identifier.name; + return true; +} - if (!this.setTypes.has(name)) { - return false; - } - const variable = this.setTypes.get(name); +function resolveTypeLike(this: any, ref: 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: 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 esScope.Scope { + setTypes: Map = new Map(); + + /** @internal */ + __defineType = defineType.bind(this); + + /** @internal */ + __resolveType = resolveType.bind(this); + + /** @internal */ + __resolveTypeLike = resolveTypeLike.bind(this); + /** @internal */ __resolve(ref: Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return super.__resolve.call(this, ref); } - return super.__resolve(ref); } } @@ -91,38 +133,22 @@ export class TypeAliasScope extends Scope { /// eslint scopes -export class GlobalScope extends esScope.GlobalScope implements Scope { +export class GlobalScope extends esScope.GlobalScope { setTypes: Map = new Map(); - types: Variable[] = []; - - __resolveType(ref: Reference) { - 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.bind(this); - return true; - } + /** @internal */ + __resolveTypeLike = resolveTypeLike.bind(this); /** @internal */ __resolve(ref: Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return esScope.Scope.prototype.__resolve.call(this, ref); } - return super.__resolve(ref); } /** @internal */ @@ -152,130 +178,68 @@ export class GlobalScope extends esScope.GlobalScope implements Scope { } } -export class FunctionExpressionNameScope - extends esScope.FunctionExpressionNameScope - implements Scope { +export class FunctionExpressionNameScope extends esScope.FunctionExpressionNameScope { setTypes: Map = new Map(); - types: Variable[] = []; - - __resolveType(ref: Reference) { - 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.bind(this); - return true; - } + /** @internal */ + __resolveType = resolveType.bind(this); /** @internal */ - __resolve(ref: Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; - } - return super.__resolve(ref); - } + __resolveTypeLike = resolveTypeLike.bind(this); /** @internal */ - __defineType(node: TSESTree.Node, def: Definition) { - if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); + __resolve(ref: Reference): boolean { + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return super.__resolve.call(this, ref); } } } -export class WithScope extends esScope.WithScope implements Scope { +export class WithScope extends esScope.WithScope { setTypes: Map = new Map(); - types: Variable[] = []; - - __resolveType(ref: Reference) { - 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.bind(this); - return true; - } + /** @internal */ + __resolveType = resolveType.bind(this); /** @internal */ - __resolve(ref: Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; - } - return super.__resolve(ref); - } + __resolveTypeLike = resolveTypeLike.bind(this); /** @internal */ - __defineType(node: TSESTree.Node, def: Definition) { - if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); + __resolve(ref: Reference): boolean { + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return super.__resolve.call(this, ref); } } } -export class FunctionScope extends esScope.FunctionScope implements Scope { +export class FunctionScope extends esScope.FunctionScope { setTypes: Map = new Map(); - types: Variable[] = []; - __resolveType(ref: Reference) { - 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.bind(this); - return true; - } + /** @internal */ + __resolveType = resolveType.bind(this); /** @internal */ - __resolve(ref: Reference): boolean { - if (ref.typeMode && this.__resolveType(ref)) { - return true; - } - return super.__resolve(ref); - } + __resolveTypeLike = resolveTypeLike.bind(this); /** @internal */ - __defineType(node: TSESTree.Node, def: Definition) { - if (node && node.type === AST_NODE_TYPES.Identifier) { - this.__defineGeneric(node.name, this.setTypes, this.variables, node, def); + __resolve(ref: 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 e729ace843f6..06d7cd49645c 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 47d641042c7a..2412152bba98 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -8730,9 +8730,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -8889,6 +8887,9 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "module", "typeMap": Object {}, @@ -8939,11 +8940,7 @@ Object { }, ], "name": "M", - "references": Array [ - Object { - "$ref": 5, - }, - ], + "references": Array [], "scope": Object { "$ref": 8, }, @@ -8958,6 +8955,9 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "global", "typeMap": Object {}, @@ -26072,9 +26072,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -26097,7 +26095,11 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "typeMap": Object {}, "upperScope": Object { @@ -26148,9 +26150,6 @@ Object { ], "name": "x", "references": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -26191,7 +26190,11 @@ Object { }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "typeMap": Object {}, "upperScope": Object { @@ -26262,7 +26265,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, @@ -26322,9 +26329,7 @@ Object { "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 2, - }, + "resolved": null, "writeExpr": undefined, }, Object { @@ -26347,7 +26352,11 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "typeMap": Object {}, "upperScope": Object { @@ -26412,9 +26421,6 @@ Object { ], "name": "x", "references": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 4, }, @@ -26429,7 +26435,11 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "typeMap": Object {}, "upperScope": Object { @@ -26490,7 +26500,11 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "typeMap": Object {}, "upperScope": null, From 17419427283505cf79f7ab143561b6cbac1efaff Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 13 Feb 2019 23:58:25 +0100 Subject: [PATCH 11/12] chore(parser): fix code formatting --- packages/parser/tests/tools/scope-analysis.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts index 9ef9b994f58f..b76a3026d07e 100644 --- a/packages/parser/tests/tools/scope-analysis.ts +++ b/packages/parser/tests/tools/scope-analysis.ts @@ -1,7 +1,7 @@ /** Reference resolver. */ -import { Reference, Variable } from "eslint-scope"; -import { Scope } from "../../src/scope/scopes"; -import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/typescript-estree"; +import { Reference, Variable } from 'eslint-scope'; +import { Scope } from '../../src/scope/scopes'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/typescript-estree'; export class ReferenceResolver { map: Map; @@ -54,7 +54,10 @@ export function nodeToJSON(node: TSESTree.Node | null): any { * @param resolver The reference resolver. * @returns {Object} The object that can be used for JSON.stringify. */ -export function variableToJSON(variable: Variable, resolver: ReferenceResolver) { +export function variableToJSON( + variable: Variable, + resolver: ReferenceResolver +) { const { name, eslintUsed } = variable; const defs = variable.defs.map((d: any) => ({ type: d.type, From 252d0042ccc346a27e4d846179aa916290b4d9cb Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 14 Feb 2019 02:01:22 +0100 Subject: [PATCH 12/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 | 607 +++++++++--------- 4 files changed, 588 insertions(+), 519 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 33e536ad0e81..c174ac184fc7 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts @@ -76,6 +76,10 @@ function A() {} 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 07f6ab3d4eeb..d6bf57456f5a 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -370,8 +370,6 @@ class Referencer extends OriginalReferencer { const scopeManager = this.scopeManager; const scope = this.currentScope(); - this.visit(node.typeParameters); - if (node.id) { scope.__defineType( node.id, @@ -381,6 +379,8 @@ class Referencer extends OriginalReferencer { 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 06d7cd49645c..6fdcf9952210 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 2412152bba98..4f353b94fb7f 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -20920,7 +20920,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 3, }, @@ -20928,7 +20932,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, @@ -20938,9 +20983,6 @@ Object { "type": "module", "typeMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -20954,46 +20996,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 { @@ -22091,7 +22093,11 @@ Object { }, ], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 5, }, @@ -22099,7 +22105,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, @@ -22116,9 +22163,6 @@ Object { "type": "module", "typeMap": Object { "Foo": Object { - "$ref": 1, - }, - "T": Object { "$ref": 0, }, }, @@ -22132,46 +22176,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 { @@ -22271,7 +22275,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "interface", - "typeMap": Object {}, + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { "$ref": 3, }, @@ -22279,7 +22287,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, @@ -22288,63 +22337,20 @@ Object { "throughReferences": Array [], "type": "module", "typeMap": Object { - "T": Object { - "$ref": 0, - }, "Test": Object { - "$ref": 1, - }, - }, - "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, - }, + "$ref": 0, }, + }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { @@ -27375,7 +27381,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 22, + "$id": 23, "block": Object { "range": Array [ 0, @@ -27385,7 +27391,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 21, + "$id": 22, "block": Object { "range": Array [ 0, @@ -27395,7 +27401,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 9, "block": Object { "range": Array [ 0, @@ -27408,9 +27414,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 9, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 9, }, "identifier": Object { "name": "A", @@ -27422,7 +27428,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 8, + "$ref": 7, }, "writeExpr": undefined, }, @@ -27431,23 +27437,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 { @@ -27483,11 +27489,11 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 9, }, }, Object { - "$id": 8, + "$id": 7, "defs": Array [ Object { "name": Object { @@ -27523,17 +27529,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, @@ -27546,9 +27552,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 13, + "$id": 12, "from": Object { - "$ref": 14, + "$ref": 13, }, "identifier": Object { "name": "A", @@ -27560,7 +27566,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 12, + "$ref": 11, }, "writeExpr": undefined, }, @@ -27569,23 +27575,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 { @@ -27621,11 +27627,11 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, Object { - "$id": 12, + "$id": 11, "defs": Array [ Object { "name": Object { @@ -27661,11 +27667,11 @@ Object { "name": "A", "references": Array [ Object { - "$ref": 13, + "$ref": 12, }, ], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, ], @@ -27698,7 +27704,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 4, + "$ref": 3, }, "writeExpr": undefined, }, @@ -27717,7 +27723,7 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 14, }, "writeExpr": undefined, }, @@ -27726,23 +27732,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, @@ -27755,9 +27807,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 18, + "$id": 19, "from": Object { - "$ref": 20, + "$ref": 21, }, "identifier": Object { "name": "bar", @@ -27769,14 +27821,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", @@ -27788,38 +27840,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", @@ -27834,9 +27932,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 21, + "$ref": 22, }, "identifier": Object { "name": "bar", @@ -27853,26 +27951,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 { @@ -27883,7 +27978,7 @@ Object { }, }, "variableScope": Object { - "$ref": 21, + "$ref": 22, }, "variables": Array [ Object { @@ -27923,7 +28018,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 22, }, }, Object { @@ -27963,85 +28058,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 { @@ -28077,15 +28098,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 { @@ -28125,7 +28146,7 @@ Object { }, ], "scope": Object { - "$ref": 21, + "$ref": 22, }, }, ], @@ -28136,10 +28157,10 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 4, }, Object { - "$ref": 6, + "$ref": 5, }, ], "type": "global", @@ -28147,7 +28168,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 22, + "$ref": 23, }, "variables": Array [], }