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/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-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/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts index 7e811be479d4..185c65a4f611 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -3,10 +3,10 @@ import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parserOptions: { - ecmaVersion: 6, - sourceType: 'module', - ecmaFeatures: {} + ecmaVersion: 10, + 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 @@ -60,14 +64,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/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index a9ca37ca4ea4..a06137bf8a0b 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,132 @@ 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 assigned a value but never used.", + line: 2, + column: 7 + } + ]) + }, + { + code: ` +type foo = 2; +const test = foo; +class bar {}; + `, + errors: error([ + { + message: "'foo' is defined but never used.", + line: 2, + column: 6 + }, + { + message: "'test' is assigned a value but never used.", + line: 3, + column: 7 + }, + { + message: "'bar' is defined but never used.", + line: 4, + column: 7 + }, + { + message: "'test' is defined but never used.", + line: 4, + column: 11 + } + ]) + }, + { + code: ` +interface IFoo { + fieldName: FormFieldIds, +} + `, + errors: error([ + { + message: "'IFoo' is defined but never used.", + line: 2, + column: 11 + } + ]) + }, + { + code: ` +import { Foo, Bar } from './types'; +export class Baz { } + `, + errors: error([ + { + message: "'F' is defined but never used.", + line: 3, + column: 18 + } + ]) } ] }); diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts index 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..d6bf57456f5a 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -1,6 +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'; import { getKeys as fallback } from 'eslint-visitor-keys'; @@ -12,81 +9,17 @@ import { } from 'eslint-scope/lib/options'; import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; -/** - * 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); - } - - 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); - } - } -} +import { + Definition, + ParameterDefinition, + TypeDefinition +} 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'; -class Referencer extends OriginalReferencer { +class Referencer extends OriginalReferencer { protected typeMode: boolean; constructor(options: any, scopeManager: ScopeManager) { @@ -102,8 +35,8 @@ class Referencer extends OriginalReferencer { */ visitPattern( node: T, - options: PatternVisitorOptions, - callback: PatternVisitorCallback + options: PatternVisitorOptions | PatternVisitorCallback, + callback?: PatternVisitorCallback ): void { if (!node) { return; @@ -114,11 +47,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 +84,6 @@ class Referencer extends OriginalReferencer { const def = defs[i]; if ( def.type === 'FunctionName' && - // @ts-ignore def.node.type === 'TSDeclareFunction' ) { defs.splice(i, 1); @@ -210,10 +142,30 @@ 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; + if (node.typeParameters) { + this.visit(node.typeParameters); + } if (node.superTypeParameters) { this.visit(node.superTypeParameters); } @@ -222,7 +174,9 @@ class Referencer extends OriginalReferencer { } this.typeMode = upperTypeMode; - super.visitClass(node); + this.visit(node.body); + + this.close(node); } /** @@ -257,9 +211,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) { + if (this.typeMode) { + typeReferencing(currentScope, node); + } else { super.Identifier(node); } @@ -406,7 +364,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(); + + if (node.id) { + scope.__defineType( + node.id, + new TypeDefinition('InterfaceName', node.id, node, null, null, null) + ); + } + + scopeManager.__nestInterfaceScope(node); + + this.visit(node.typeParameters); + + if (node.extends) { + node.extends.forEach(this.visit, this); + } + + this.visit(node.body); + this.close(node); + + this.typeMode = upperTypeMode; } /** @@ -424,7 +406,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; } /** @@ -472,7 +470,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().__defineType( + pattern, + new TypeDefinition('TypeParameter', pattern, node, null, i) + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + } + ); + } } /** @@ -593,21 +607,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 +615,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 +709,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.__defineType( + 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 +748,7 @@ class Referencer extends OriginalReferencer { TSAbstractClassProperty(node: TSESTree.TSAbstractClassProperty): void { this.ClassProperty(node); } + TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void { this.MethodDefinition(node); } @@ -752,11 +777,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') { @@ -764,7 +785,6 @@ class Referencer extends OriginalReferencer { } scopeManager.__currentScope = currentScope; - globalScope.__define = originalDefine; } /** @@ -790,9 +810,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/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/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..78f842fcf932 100644 --- a/packages/parser/src/scope/scope-manager.ts +++ b/packages/parser/src/scope/scope-manager.ts @@ -3,13 +3,28 @@ import { TSESTree } from '@typescript-eslint/typescript-estree'; import EslintScopeManager, { ScopeManagerOptions } from 'eslint-scope/lib/scope-manager'; -import { EmptyFunctionScope, EnumScope } from './scopes'; -import { Scope } from 'eslint-scope/lib/scope'; +import { + Scope, + EmptyFunctionScope, + EnumScope, + InterfaceScope, + TypeAliasScope, + GlobalScope, + ModuleScope, + FunctionExpressionNameScope, + SwitchScope, + CatchScope, + WithScope, + BlockScope, + ForScope, + FunctionScope, + ClassScope +} from './scopes'; /** * based on eslint-scope */ -export class ScopeManager extends EslintScopeManager { +export class ScopeManager extends EslintScopeManager { scopes!: Scope[]; globalScope!: Scope; @@ -18,14 +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): Scope { + return this.__nestScope( + new InterfaceScope(this, this.__currentScope, node) + ); + } + + /** @internal */ + __nestTypeAliasScope(node: TSESTree.TSTypeAliasDeclaration): Scope { + return this.__nestScope( + new TypeAliasScope(this, this.__currentScope, node) + ); + } + + /// eslint scopes + + /** @internal */ + __nestGlobalScope(node: TSESTree.Node): Scope { + return this.__nestScope(new GlobalScope(this, node)); + } + + /** @internal */ + __nestBlockScope(node: TSESTree.Node): Scope { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): Scope { + return this.__nestScope( + new FunctionScope(this, this.__currentScope, node, isMethodDefinition) + ); + } + + /** @internal */ + __nestForScope(node: TSESTree.Node): Scope { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestCatchScope(node: TSESTree.Node): Scope { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestWithScope(node: TSESTree.Node): Scope { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestClassScope(node: TSESTree.Node): Scope { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestSwitchScope(node: TSESTree.Node): Scope { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestModuleScope(node: TSESTree.Node): Scope { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + /** @internal */ + __nestFunctionExpressionNameScope(node: TSESTree.Node): Scope { + return this.__nestScope( + new FunctionExpressionNameScope(this, this.__currentScope, node) + ); + } } diff --git a/packages/parser/src/scope/scopes.ts b/packages/parser/src/scope/scopes.ts index efb3fc719c70..2f5cc19ceee1 100644 --- a/packages/parser/src/scope/scopes.ts +++ b/packages/parser/src/scope/scopes.ts @@ -1,6 +1,93 @@ -import { Scope } from 'eslint-scope/lib/scope'; +import * as esScope from 'eslint-scope/lib/scope'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import { ScopeManager } from './scope-manager'; -import { TSESTree } from '@typescript-eslint/typescript-estree'; +import { Reference } from 'eslint-scope'; +import { Definition } from 'eslint-scope/lib/definition'; +import Variable from 'eslint-scope/lib/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); + } +} + +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; + + return true; +} + +function resolveTypeLike(this: any, ref: Reference): boolean { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable: Variable = this.set.get(name); + if (!this.__isValidResolution(ref, variable)) { + return false; + } + + if ( + !variable.defs.some( + d => + d.type === 'ClassName' || + d.type === 'EnumName' || + d.type === 'ImportBinding' + ) + ) { + return false; + } + + variable.references.push(ref); + variable.stack = + variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + return true; +} + +export class Scope extends 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) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return super.__resolve.call(this, ref); + } + } +} /** The scope class for enum. */ export class EnumScope extends Scope { @@ -23,3 +110,198 @@ 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); + } +} + +/// eslint scopes + +export class GlobalScope extends esScope.GlobalScope { + setTypes: Map = new Map(); + + /** @internal */ + __resolveType = resolveType.bind(this); + + /** @internal */ + __resolveTypeLike = resolveTypeLike.bind(this); + + /** @internal */ + __resolve(ref: Reference): boolean { + if (ref.typeMode) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return esScope.Scope.prototype.__resolve.call(this, ref); + } + } + + /** @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); + + // 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) { + if (node && node.type === AST_NODE_TYPES.Identifier) { + super.__define(node, definition); + + // Set `variable.eslintUsed` to tell ESLint that the variable is exported. + const variable = this.set.get(node.name); + if (variable) { + variable.eslintUsed = true; + } + } + } +} + +export class FunctionExpressionNameScope extends esScope.FunctionExpressionNameScope { + 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) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return super.__resolve.call(this, ref); + } + } +} + +export class WithScope extends esScope.WithScope { + 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) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return super.__resolve.call(this, ref); + } + } +} + +export class FunctionScope extends esScope.FunctionScope { + 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) { + return this.__resolveType(ref) || this.__resolveTypeLike(ref); + } else { + return super.__resolve.call(this, ref); + } + } +} + +// 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/fixtures/scope-analysis/class-with-type-extends-default.ts b/packages/parser/tests/fixtures/scope-analysis/class-with-type-extends-default.ts new file mode 100644 index 000000000000..27af80fa498c --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/class-with-type-extends-default.ts @@ -0,0 +1 @@ +export class Bar {} diff --git a/packages/parser/tests/fixtures/scope-analysis/empty-body-function.ts b/packages/parser/tests/fixtures/scope-analysis/empty-body-function.ts new file mode 100644 index 000000000000..731b9ec178a9 --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/empty-body-function.ts @@ -0,0 +1 @@ +function eachr(subject: Map): typeof subject; diff --git a/packages/parser/tests/fixtures/scope-analysis/mixed-variable-ref.ts b/packages/parser/tests/fixtures/scope-analysis/mixed-variable-ref.ts new file mode 100644 index 000000000000..a6a7723cd610 --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/mixed-variable-ref.ts @@ -0,0 +1,2 @@ +const foo = 2; +new test(); diff --git a/packages/parser/tests/fixtures/scope-analysis/typed-this.src.ts b/packages/parser/tests/fixtures/scope-analysis/typed-this.src.ts new file mode 100644 index 000000000000..60c279230003 --- /dev/null +++ b/packages/parser/tests/fixtures/scope-analysis/typed-this.src.ts @@ -0,0 +1 @@ +function test(this: String) {} diff --git a/packages/parser/tests/lib/__snapshots__/basics.ts.snap b/packages/parser/tests/lib/__snapshots__/basics.ts.snap index 9678bad3ecee..2020b01681ad 100644 --- a/packages/parser/tests/lib/__snapshots__/basics.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/basics.ts.snap @@ -48,6 +48,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -67,6 +68,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -142,6 +144,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -202,6 +205,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -278,6 +282,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -323,6 +328,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -392,6 +398,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -449,6 +456,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -605,6 +613,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -662,6 +671,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -681,6 +691,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -738,6 +749,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -757,6 +769,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -802,6 +815,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -853,6 +867,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -917,6 +932,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -952,6 +968,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -967,6 +984,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1036,6 +1054,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -1112,6 +1131,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -1232,6 +1252,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1267,6 +1288,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -1282,6 +1304,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { diff --git a/packages/parser/tests/lib/__snapshots__/javascript.ts.snap b/packages/parser/tests/lib/__snapshots__/javascript.ts.snap index 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 d18abf288ba1..6fdcf9952210 100644 --- a/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/scope-analysis.ts.snap @@ -56,6 +56,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -134,6 +135,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -194,6 +196,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -239,6 +242,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -299,6 +303,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -359,6 +364,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -370,7 +376,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-implements.ts 1`] = ` Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ 0, @@ -380,7 +386,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 8, "block": Object { "range": Array [ 0, @@ -390,7 +396,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 7, "block": Object { "range": Array [ 0, @@ -401,11 +407,97 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Component", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Nullable", + "range": Array [ + 41, + 49, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "SomeOther", + "range": Array [ + 50, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Component2", + "range": Array [ + 67, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "class", + "typeMap": Object { + "Nullable": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -413,7 +505,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { @@ -453,7 +545,51 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 7, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Nullable", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 7, }, }, ], @@ -462,10 +598,21 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 9, }, "variableMap": Object { "Foo": Object { @@ -473,7 +620,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 8, }, "variables": Array [ Object { @@ -513,7 +660,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, ], @@ -522,12 +669,23 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [], } @@ -615,6 +773,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -722,6 +881,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -845,6 +1005,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -856,7 +1017,7 @@ Object { exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-supper-type.ts 1`] = ` Object { - "$id": 13, + "$id": 16, "block": Object { "range": Array [ 0, @@ -866,7 +1027,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 0, @@ -876,7 +1037,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -887,11 +1048,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo": Object { @@ -899,7 +1083,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { @@ -939,13 +1123,13 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], }, Object { - "$id": 9, + "$id": 11, "block": Object { "range": Array [ 42, @@ -956,23 +1140,46 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 10, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo2": Object { - "$ref": 8, + "$ref": 9, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { - "$id": 8, + "$id": 9, "defs": Array [ Object { "name": Object { @@ -1008,13 +1215,13 @@ Object { "name": "Foo2", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 11, }, }, ], }, Object { - "$id": 11, + "$id": 14, "block": Object { "range": Array [ 84, @@ -1025,23 +1232,46 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 107, + 110, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 15, }, "variableMap": Object { "Foo3": Object { - "$ref": 10, + "$ref": 12, }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { - "$id": 10, + "$id": 12, "defs": Array [ Object { "name": Object { @@ -1077,7 +1307,7 @@ Object { "name": "Foo3", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 14, }, }, ], @@ -1089,7 +1319,7 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1106,7 +1336,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1123,7 +1353,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 12, + "$ref": 15, }, "identifier": Object { "name": "Bar", @@ -1142,16 +1372,26 @@ Object { Object { "$ref": 3, }, + Object { + "$ref": 7, + }, Object { "$ref": 4, }, + Object { + "$ref": 10, + }, Object { "$ref": 5, }, + Object { + "$ref": 13, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 13, + "$ref": 16, }, "variableMap": Object { "Foo": Object { @@ -1165,7 +1405,7 @@ Object { }, }, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, "variables": Array [ Object { @@ -1205,7 +1445,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, Object { @@ -1245,7 +1485,7 @@ Object { "name": "Foo2", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, Object { @@ -1285,7 +1525,7 @@ Object { "name": "Foo3", "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 15, }, }, ], @@ -1298,298 +1538,251 @@ Object { Object { "$ref": 3, }, + Object { + "$ref": 7, + }, Object { "$ref": 4, }, + Object { + "$ref": 10, + }, Object { "$ref": 5, }, + Object { + "$ref": 13, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 16, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/class-with-type-extends-default.ts 1`] = ` Object { - "$id": 9, + "$id": 6, "block": Object { "range": Array [ 0, - 110, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 110, + 39, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, + "childScopes": Array [ Object { "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 54, - 56, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", + "block": Object { "range": Array [ - 71, - 73, + 7, + 38, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "type": "ClassDeclaration", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", + "$id": 3, + "from": Object { + "$ref": 4, }, - "parent": Object { + "identifier": Object { + "name": "Foo", "range": Array [ - 0, - 34, + 27, + 30, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", + "$ref": 3, }, ], - "name": "s1", - "references": Array [ - Object { + "type": "class", + "typeMap": Object { + "T": Object { "$ref": 2, }, - Object { - "$ref": 6, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "Bar": Object { + "$ref": 1, }, - ], - "scope": Object { - "$ref": 8, }, - }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 38, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Bar", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 35, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 1, + "$ref": 3, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Bar": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "s2", + "name": "Bar", "range": Array [ - 21, - 23, + 13, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, + 7, + 38, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s2", + "name": "Bar", "range": Array [ - 21, - 23, + 13, + 16, ], "type": "Identifier", }, ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], + "name": "Bar", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 5, }, }, ], @@ -1602,178 +1795,263 @@ Object { Object { "$ref": 3, }, - Object { - "$ref": 5, - }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 6, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` Object { - "$id": 9, + "$id": 13, "block": Object { "range": Array [ 0, - 107, + 110, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 12, "block": Object { "range": Array [ 0, - 107, + 110, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, + "childScopes": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", + "$id": 11, + "block": Object { "range": Array [ - 51, - 53, + 35, + 109, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 54, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 71, + 73, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 75, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 87, + 97, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + "kind": "w", "resolved": Object { "$ref": 0, }, + "writeExpr": Object { + "range": Array [ + 11, + 19, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 12, }, "identifier": Object { "name": "s2", "range": Array [ - 68, - 70, + 21, + 23, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { "$ref": 1, }, + "writeExpr": Object { + "range": Array [ + 26, + 34, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 9, + "$ref": 13, }, "variableMap": Object { "s1": Object { @@ -1784,7 +2062,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 12, }, "variables": Array [ Object { @@ -1830,14 +2108,11 @@ Object { "name": "s1", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 6, + "$ref": 3, }, ], "scope": Object { - "$ref": 8, + "$ref": 12, }, }, Object { @@ -1883,14 +2158,51 @@ Object { "name": "s2", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ Object { - "$ref": 7, + "name": Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 109, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", }, ], + "name": "A", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 12, }, }, ], @@ -1901,148 +2213,291 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 13, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` Object { - "$id": 5, + "$id": 13, "block": Object { "range": Array [ 0, - 40, + 107, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 12, "block": Object { "range": Array [ 0, - 40, + 107, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 11, "block": Object { "range": Array [ - 0, - 37, + 35, + 106, ], - "type": "TSDeclareFunction", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 51, + 53, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 68, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 72, + 82, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 84, + 94, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 1, + "$id": 3, "from": Object { - "$ref": 4, + "$ref": 12, }, "identifier": Object { - "name": "f", + "name": "s1", "range": Array [ - 38, - 39, + 6, + 8, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { "$ref": 0, }, + "writeExpr": Object { + "range": Array [ + 11, + 19, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 26, + 34, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 5, + "$ref": 13, }, "variableMap": Object { - "f": Object { + "s1": Object { "$ref": 0, }, + "s2": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 4, + "$ref": 12, }, "variables": Array [ Object { @@ -2050,43 +2505,139 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "s1", "range": Array [ - 17, - 18, + 6, + 8, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 37, + 34, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "s1", "range": Array [ - 17, - 18, + 6, + 8, ], "type": "Identifier", }, ], - "name": "f", + "name": "s1", "references": Array [ Object { - "$ref": 1, + "$ref": 3, }, ], "scope": Object { - "$ref": 4, + "$ref": 12, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 34, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + ], + "name": "s2", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 106, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, }, }, ], @@ -2095,24 +2646,44 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 13, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function.ts 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 70, + 40, ], "type": "Program", }, @@ -2122,7 +2693,7 @@ Object { "block": Object { "range": Array [ 0, - 70, + 40, ], "type": "Program", }, @@ -2132,42 +2703,23 @@ Object { "block": Object { "range": Array [ 0, - 69, + 37, ], "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "subject", - "range": Array [ - 61, - 68, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "subject": Object { - "$ref": 1, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { @@ -2175,21 +2727,21 @@ Object { }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "subject", + "name": "a", "range": Array [ - 27, - 51, + 19, + 28, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 69, + 37, ], "type": "TSDeclareFunction", }, @@ -2200,20 +2752,16 @@ Object { "eslintUsed": true, "identifiers": Array [ Object { - "name": "subject", + "name": "a", "range": Array [ - 27, - 51, + 19, + 28, ], "type": "Identifier", }, ], - "name": "subject", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "a", + "references": Array [], "scope": Object { "$ref": 3, }, @@ -2223,14 +2771,35 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "f", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "eachr": Object { + "f": Object { "$ref": 0, }, }, @@ -2243,17 +2812,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "eachr", + "name": "f", "range": Array [ - 9, - 14, + 17, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 69, + 37, ], "type": "TSDeclareFunction", }, @@ -2264,16 +2833,20 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "eachr", + "name": "f", "range": Array [ - 9, - 14, + 17, + 18, ], "type": "Identifier", }, ], - "name": "eachr", - "references": Array [], + "name": "f", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { "$ref": 4, }, @@ -2286,6 +2859,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2295,185 +2869,105 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-global.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` Object { - "$id": 3, + "$id": 10, "block": Object { "range": Array [ 0, - 55, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 9, "block": Object { "range": Array [ 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-module.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 95, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 95, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ - 33, - 92, + 0, + 69, ], - "type": "TSModuleBlock", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, Object { "$id": 5, "from": Object { - "$ref": 6, + "$ref": 8, }, "identifier": Object { - "name": "a", + "name": "Key", "range": Array [ - 89, - 90, + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Value", + "range": Array [ + 45, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "subject", + "range": Array [ + 61, + 68, ], "type": "Identifier", }, @@ -2484,117 +2978,162 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "block", + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "empty-function", + "typeMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "a": Object { + "subject": Object { "$ref": 3, }, - "b": Object { - "$ref": 4, - }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "Key", "range": Array [ - 52, - 61, + 15, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 52, - 61, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 46, - 61, + 14, + 26, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "Key", "range": Array [ - 52, - 61, + 15, + 18, ], "type": "Identifier", }, ], - "name": "a", + "name": "Key", "references": Array [ Object { "$ref": 5, }, ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, Object { - "$id": 4, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "b", + "name": "Value", "range": Array [ - 79, - 90, + 20, + 25, ], "type": "Identifier", }, "node": Object { "range": Array [ - 79, - 90, + 14, + 26, ], - "type": "VariableDeclarator", + "type": "TSTypeParameterDeclaration", }, - "parent": Object { + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "subject", "range": Array [ - 73, - 90, + 27, + 51, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "node": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "b", + "name": "subject", "range": Array [ - 79, - 90, + 27, + 51, ], "type": "Identifier", }, ], - "name": "b", - "references": Array [], + "name": "subject", + "references": Array [ + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -2602,64 +3141,24 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 93, - 94, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "$ref": 4, }, ], - "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { - "a": Object { + "eachr": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -2667,52 +3166,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "eachr", "range": Array [ - 6, - 7, + 9, + 14, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 11, + 69, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "eachr", "range": Array [ - 6, - 7, + 9, + 14, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "name": "eachr", + "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -2721,264 +3207,166 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-global.ts 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 65, + 55, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ 0, - 65, + 55, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 5, - "block": Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "C", "range": Array [ - 15, - 64, + 38, + 39, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, + "kind": "w", + "resolved": Object { + "$ref": 0, }, - "variableScope": Object { - "$ref": 6, + "writeExpr": Object { + "range": Array [ + 42, + 43, + ], + "type": "Literal", }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 1, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 3, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "C": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 7, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 25, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 34, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 21, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 25, + 34, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 3, + }, + }, + ], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/declare-module.ts 1`] = ` Object { "$id": 8, "block": Object { "range": Array [ 0, - 65, + 95, ], "type": "Program", }, @@ -2988,7 +3376,7 @@ Object { "block": Object { "range": Array [ 0, - 65, + 95, ], "type": "Program", }, @@ -2997,133 +3385,47 @@ Object { "$id": 6, "block": Object { "range": Array [ - 15, - 64, + 33, + 92, ], - "type": "ClassDeclaration", + "type": "TSModuleBlock", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { "$id": 5, - "block": Object { + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "a", "range": Array [ - 40, - 62, + 89, + 90, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, + "kind": "r", + "resolved": Object { + "$ref": 3, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, + "writeExpr": undefined, }, ], - "type": "class", + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "a": Object { + "$ref": 3, + }, + "b": Object { + "$ref": 4, }, }, "variableScope": Object { @@ -3131,40 +3433,96 @@ Object { }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 52, + 61, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 52, + 61, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 46, + 61, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 52, + 61, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "a", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "b", + "range": Array [ + 79, + 90, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 79, + 90, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 73, + 90, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "b", + "range": Array [ + 79, + 90, + ], + "type": "Identifier", + }, + ], + "name": "b", "references": Array [], "scope": Object { "$ref": 6, @@ -3175,18 +3533,60 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "references": Array [ Object { - "$ref": 4, + "$id": 1, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 11, + ], + "type": "Literal", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 93, + 94, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], + "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "Foo": Object { + "a": Object { "$ref": 0, }, }, @@ -3199,39 +3599,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 6, + 11, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 6, + 7, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "scope": Object { + "$ref": 7, }, }, ], @@ -3240,12 +3653,9 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3255,13 +3665,13 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` Object { "$id": 7, "block": Object { "range": Array [ 0, - 60, + 65, ], "type": "Program", }, @@ -3271,7 +3681,7 @@ Object { "block": Object { "range": Array [ 0, - 60, + 65, ], "type": "Program", }, @@ -3281,7 +3691,7 @@ Object { "block": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3291,7 +3701,7 @@ Object { "block": Object { "range": Array [ 40, - 57, + 62, ], "type": "FunctionExpression", }, @@ -3323,6 +3733,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -3358,6 +3769,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3385,7 +3797,7 @@ Object { "node": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3422,6 +3834,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3449,7 +3862,7 @@ Object { "node": Object { "range": Array [ 15, - 59, + 64, ], "type": "ClassDeclaration", }, @@ -3486,6 +3899,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3495,13 +3909,13 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` Object { "$id": 8, "block": Object { "range": Array [ 0, - 82, + 65, ], "type": "Program", }, @@ -3511,7 +3925,7 @@ Object { "block": Object { "range": Array [ 0, - 82, + 65, ], "type": "Program", }, @@ -3521,7 +3935,7 @@ Object { "block": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3531,7 +3945,7 @@ Object { "block": Object { "range": Array [ 40, - 79, + 62, ], "type": "FunctionExpression", }, @@ -3563,6 +3977,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3596,15 +4011,15 @@ Object { "name": Object { "name": "test", "range": Array [ - 63, - 75, + 46, + 58, ], "type": "Identifier", }, "node": Object { "range": Array [ 40, - 79, + 62, ], "type": "FunctionExpression", }, @@ -3617,8 +4032,8 @@ Object { Object { "name": "test", "range": Array [ - 63, - 75, + 46, + 58, ], "type": "Identifier", }, @@ -3641,6 +4056,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3668,7 +4084,7 @@ Object { "node": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3705,6 +4121,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3732,7 +4149,7 @@ Object { "node": Object { "range": Array [ 15, - 81, + 64, ], "type": "ClassDeclaration", }, @@ -3769,6 +4186,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3778,43 +4196,43 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 70, + 60, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, - 70, + 60, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 15, - 69, + 59, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 40, - 67, + 57, ], "type": "FunctionExpression", }, @@ -3823,9 +4241,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 5, + "$ref": 4, }, "identifier": Object { "name": "Dec", @@ -3842,23 +4260,21 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 5, }, "variableMap": Object { "arguments": Object { "$ref": 2, }, - "test": Object { - "$ref": 3, - }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { @@ -3869,47 +4285,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 49, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 67, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 49, - 53, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, + "$ref": 4, }, }, ], @@ -3920,12 +4296,13 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -3933,7 +4310,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -3951,7 +4328,7 @@ Object { "node": Object { "range": Array [ 15, - 69, + 59, ], "type": "ClassDeclaration", }, @@ -3973,7 +4350,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -3984,12 +4361,13 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -3997,7 +4375,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -4015,7 +4393,7 @@ Object { "node": Object { "range": Array [ 15, - 69, + 59, ], "type": "ClassDeclaration", }, @@ -4037,7 +4415,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -4048,36 +4426,37 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorators.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` Object { - "$id": 19, + "$id": 8, "block": Object { "range": Array [ 0, - 198, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 18, + "$id": 7, "block": Object { "range": Array [ 0, - 198, + 82, ], "type": "Program", }, @@ -4086,183 +4465,94 @@ Object { "$id": 6, "block": Object { "range": Array [ - 0, - 29, + 15, + 81, ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "target": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 6, + "type": "ClassDeclaration", }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, + "childScopes": Array [ Object { "$id": 5, - "defs": Array [ + "block": Object { + "range": Array [ + 40, + 79, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "target", - "range": Array [ - 13, - 24, - ], - "type": "Identifier", + "$id": 4, + "from": Object { + "$ref": 5, }, - "node": Object { + "identifier": Object { + "name": "Dec", "range": Array [ - 0, - 29, + 42, + 45, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "Parameter", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "target", - "range": Array [ - 13, - 24, - ], - "type": "Identifier", + "$ref": 4, }, ], - "name": "target", - "references": Array [], - "scope": Object { + "type": "function", + "typeMap": Object {}, + "upperScope": Object { "$ref": 6, }, - }, - ], - }, - Object { - "$id": 11, - "block": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, "variableMap": Object { - "propertyKey": Object { - "$ref": 9, + "arguments": Object { + "$ref": 2, }, - "target": Object { - "$ref": 8, + "test": Object { + "$ref": 3, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 5, }, "variables": Array [ Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], + "$id": 2, + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "target", - "range": Array [ - 59, - 70, - ], - "type": "Identifier", - }, - ], - "name": "target", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 5, }, }, Object { - "$id": 9, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "propertyKey", + "name": "test", "range": Array [ - 72, - 91, + 63, + 75, ], "type": "Identifier", }, "node": Object { "range": Array [ - 58, - 98, + 40, + 79, ], - "type": "ArrowFunctionExpression", + "type": "FunctionExpression", }, "parent": null, "type": "Parameter", @@ -4271,18 +4561,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "propertyKey", + "name": "test", "range": Array [ - 72, - 91, + 63, + 75, ], "type": "Identifier", }, ], - "name": "propertyKey", + "name": "test", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 5, }, }, ], @@ -4291,163 +4581,41 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 18, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 7, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 7, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - Object { - "$id": 17, - "block": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 16, - "block": Object { - "range": Array [ - 159, - 195, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 15, - }, - }, - "variableScope": Object { - "$ref": 16, - }, - "variables": Array [ - Object { - "$id": 15, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 16, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 13, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", - "range": Array [ - 122, - 125, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 14, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", - "range": Array [ - 147, - 150, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], "throughReferences": Array [ Object { - "$ref": 13, - }, - Object { - "$ref": 14, + "$ref": 4, }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 18, + "$ref": 7, }, "variableMap": Object { - "C": Object { - "$ref": 12, + "Foo": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 18, + "$ref": 7, }, "variables": Array [ Object { - "$id": 12, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Foo", "range": Array [ - 113, - 114, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 15, + 81, ], "type": "ClassDeclaration", }, @@ -4458,18 +4626,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Foo", "range": Array [ - 113, - 114, + 21, + 24, ], "type": "Identifier", }, ], - "name": "C", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 6, }, }, ], @@ -4477,45 +4645,24 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 18, - }, - "identifier": Object { - "name": "dec", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "$ref": 4, }, ], - "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 19, + "$ref": 8, }, "variableMap": Object { - "C": Object { - "$ref": 2, - }, - "dec": Object { + "Foo": Object { "$ref": 0, }, - "gec": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 18, + "$ref": 7, }, "variables": Array [ Object { @@ -4523,108 +4670,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "dec", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 29, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "dec", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "dec", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - ], - "name": "gec", - "references": Array [ - Object { - "$ref": 13, - }, - Object { - "$ref": 14, - }, - ], - "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", + "name": "Foo", "range": Array [ - 113, - 114, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 15, + 81, ], "type": "ClassDeclaration", }, @@ -4635,18 +4691,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Foo", "range": Array [ - 113, - 114, + 21, + 24, ], "type": "Identifier", }, ], - "name": "C", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 18, + "$ref": 7, }, }, ], @@ -4655,512 +4711,285 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 19, + "$ref": 8, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` Object { - "$id": 15, + "$id": 8, "block": Object { "range": Array [ 0, - 71, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 14, + "$id": 7, "block": Object { "range": Array [ 0, - 71, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 13, + "$id": 6, "block": Object { "range": Array [ - 20, - 70, + 15, + 69, ], - "type": "TSEnumDeclaration", + "type": "ClassDeclaration", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "name": "a", + "$id": 5, + "block": Object { "range": Array [ - 37, - 38, + 40, + 67, ], - "type": "Identifier", + "type": "FunctionExpression", }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 13, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "test": Object { + "$ref": 3, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 5, }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 48, - 53, - ], - "type": "BinaryExpression", - }, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 48, - 49, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 63, - 68, - ], - "type": "BinaryExpression", - }, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 63, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "B", - "range": Array [ - 67, - 68, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 49, + 53, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 67, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 49, + 53, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [ Object { - "$ref": 7, - }, - Object { - "$ref": 9, + "$ref": 4, }, ], - "type": "enum", + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 14, + "$ref": 7, }, "variableMap": Object { - "A": Object { - "$ref": 3, - }, - "B": Object { - "$ref": 4, - }, - "C": Object { - "$ref": 5, + "Foo": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 7, }, "variables": Array [ Object { - "$id": 3, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "Foo", "range": Array [ - 33, - 34, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 33, - 38, + 15, + 69, ], - "type": "TSEnumMember", + "type": "ClassDeclaration", }, "parent": undefined, - "type": "EnumMemberName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "Foo", "range": Array [ - 33, - 34, + 21, + 24, ], "type": "Identifier", }, ], - "name": "A", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 11, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 6, }, }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 53, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - ], - "name": "B", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 59, - 68, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 19, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { - "E": Object { - "$ref": 1, - }, - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 19, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { "name": Object { - "name": "E", + "name": "Foo", "range": Array [ - 25, - 26, + 21, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 70, + 15, + 69, ], - "type": "TSEnumDeclaration", + "type": "ClassDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "E", + "name": "Foo", "range": Array [ - 25, - 26, + 21, + 24, ], "type": "Identifier", }, ], - "name": "E", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 7, }, }, ], @@ -5169,871 +4998,964 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 8, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum-string.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/decorators.ts 1`] = ` Object { - "$id": 5, + "$id": 19, "block": Object { "range": Array [ 0, - 29, + 198, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 18, "block": Object { "range": Array [ 0, - 29, + 198, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 28, + 29, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "BAR", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "Literal", - }, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "enum", + "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 18, }, "variableMap": Object { - "BAR": Object { - "$ref": 1, + "arguments": Object { + "$ref": 4, + }, + "target": Object { + "$ref": 5, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { - "$id": 1, + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 5, "defs": Array [ Object { "name": Object { - "name": "BAR", + "name": "target", "range": Array [ - 15, - 18, + 13, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 26, + 0, + 29, ], - "type": "TSEnumMember", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumMemberName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "BAR", + "name": "target", "range": Array [ - 15, - 18, + 13, + 24, ], "type": "Identifier", }, ], - "name": "BAR", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "target", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 11, + "block": Object { + "range": Array [ + 30, + 100, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "Foo", + "$id": 10, + "block": Object { "range": Array [ - 5, - 8, + 58, + 98, ], - "type": "Identifier", + "type": "ArrowFunctionExpression", }, - "node": Object { - "range": Array [ - 0, - 28, - ], - "type": "TSEnumDeclaration", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 5, - 8, + "variableMap": Object { + "propertyKey": Object { + "$ref": 9, + }, + "target": Object { + "$ref": 8, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "target", + "range": Array [ + 59, + 70, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "target", + "range": Array [ + 59, + 70, + ], + "type": "Identifier", + }, + ], + "name": "target", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + Object { + "$id": 9, + "defs": Array [ + Object { + "name": Object { + "name": "propertyKey", + "range": Array [ + 72, + 91, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "propertyKey", + "range": Array [ + 72, + 91, + ], + "type": "Identifier", + }, + ], + "name": "propertyKey", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, ], - "type": "Identifier", }, ], - "name": "Foo", + "functionExpressionScope": false, + "isStrict": true, "references": Array [], - "scope": Object { - "$ref": 4, + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 7, + }, }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + Object { + "$id": 17, + "block": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 16, + "block": Object { + "range": Array [ + 159, + 195, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 15, + }, + }, + "variableScope": Object { + "$ref": 16, + }, + "variables": Array [ + Object { + "$id": 15, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 16, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "gec", + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "gec", + "range": Array [ + 147, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "C": Object { + "$ref": 12, + }, + }, + "variableScope": Object { + "$ref": 18, + }, + "variables": Array [ + Object { + "$id": 12, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 17, + }, + }, + ], }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 3, "from": Object { - "$ref": 1, + "$ref": 18, }, "identifier": Object { - "name": "a", + "name": "dec", "range": Array [ - 20, - 21, + 103, + 106, ], "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 19, + }, + "variableMap": Object { + "C": Object { + "$ref": 2, + }, + "dec": Object { + "$ref": 0, + }, + "gec": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 18, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-as.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "variables": Array [ Object { "$id": 0, - "from": Object { - "$ref": 1, + "defs": Array [ + Object { + "name": Object { + "name": "dec", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "dec", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + ], + "name": "dec", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 18, }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "gec", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 30, + 100, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "gec", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + ], + "name": "gec", + "references": Array [ + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$ref": 18, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, }, - ], - "throughReferences": Array [ Object { - "$ref": 0, + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 18, + }, }, ], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 19, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/empty-body-function.ts 1`] = ` Object { - "$id": 15, + "$id": 10, "block": Object { "range": Array [ 0, - 67, + 70, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 14, + "$id": 9, "block": Object { "range": Array [ 0, - 67, + 70, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, + "childScopes": Array [ Object { "$id": 8, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "c", + "block": Object { "range": Array [ - 43, - 44, + 0, + 69, ], - "type": "Identifier", + "type": "TSDeclareFunction", }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 48, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "e", - "range": Array [ - 60, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": undefined, - }, - Object { - "$id": 13, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 63, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 15, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { - "$ref": 1, - }, - "c": Object { - "$ref": 2, - }, - "d": Object { - "$ref": 3, - }, - "e": Object { - "$ref": 4, - }, - "f": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "a", + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", "range": Array [ - 6, - 7, + 36, + 39, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 6, - 7, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, }, - "parent": Object { + "identifier": Object { + "name": "Key", "range": Array [ - 0, - 22, + 40, + 43, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 7, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ Object { - "name": Object { - "name": "b", + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Value", "range": Array [ - 9, - 10, + 45, + 50, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": Object { + "$ref": 2, }, - "parent": Object { + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "subject", "range": Array [ - 0, - 22, + 61, + 68, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "$ref": 4, }, ], - "name": "b", - "references": Array [ - Object { - "$ref": 8, + "type": "empty-function", + "typeMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, }, - ], - "scope": Object { - "$ref": 14, }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 13, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "name": "c", - "references": Array [ - Object { - "$ref": 9, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "subject": Object { + "$ref": 3, }, - ], - "scope": Object { - "$ref": 14, }, - }, - Object { - "$id": 3, - "defs": Array [ + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ Object { - "name": Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 16, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Key", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 8, }, - "type": "Variable", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "d", - "range": Array [ - 15, - 16, + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, }, - ], - "name": "d", - "references": Array [ Object { - "$ref": 11, + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "subject", + "range": Array [ + 27, + 51, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "subject", + "range": Array [ + 27, + 51, + ], + "type": "Identifier", + }, + ], + "name": "subject", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, }, ], - "scope": Object { - "$ref": 14, - }, }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 4, + "$ref": 4, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "eachr": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "e", + "name": "eachr", "range": Array [ - 18, - 19, + 9, + 14, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 18, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 69, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "e", + "name": "eachr", "range": Array [ - 18, - 19, + 9, + 14, ], "type": "Identifier", }, ], - "name": "e", - "references": Array [ - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 13, - }, - ], + "name": "eachr", + "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 9, }, }, ], @@ -6044,404 +5966,371 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 6, - }, - Object { - "$ref": 10, + "$ref": 4, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 10, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum.ts 1`] = ` Object { - "$id": 8, + "$id": 15, "block": Object { "range": Array [ 0, - 101, + 71, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 14, "block": Object { "range": Array [ 0, - 101, + 71, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], - }, - Object { - "$id": 3, + "$id": 13, "block": Object { "range": Array [ - 19, - 46, + 20, + 70, ], - "type": "TSDeclareFunction", + "type": "TSEnumDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ + "references": Array [ Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { "$ref": 3, }, + "writeExpr": Object { + "name": "a", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, }, - ], - }, - Object { - "$id": 6, - "block": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 5, - }, - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, }, + "writeExpr": undefined, }, Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 58, - 68, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 58, - 68, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 6, + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": Object { + "range": Array [ + 48, + 53, + ], + "type": "BinaryExpression", }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ Object { - "name": Object { - "name": "f", + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "a", "range": Array [ - 56, - 57, + 48, + 49, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "C", "range": Array [ - 47, - 100, + 59, + 60, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "FunctionName", + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { + "range": Array [ + 63, + 68, + ], + "type": "BinaryExpression", + }, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 63, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "f", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", + "$ref": 7, + }, + Object { + "$ref": 9, }, ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", + "type": "enum", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 14, }, "variableMap": Object { - "a": Object { - "$ref": 2, + "A": Object { + "$ref": 3, }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ + "B": Object { + "$ref": 4, + }, + "C": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "A", "range": Array [ - 30, - 39, + 33, + 34, ], "type": "Identifier", }, "node": Object { "range": Array [ - 19, - 46, + 33, + 38, ], - "type": "TSDeclareFunction", + "type": "TSEnumMember", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "EnumMemberName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "A", "range": Array [ - 30, - 39, + 33, + 34, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 11, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 13, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 44, + 53, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 59, + 68, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 13, }, }, ], @@ -6449,19 +6338,49 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 18, + 19, + ], + "type": "Literal", + }, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 15, }, "variableMap": Object { - "f": Object { + "E": Object { + "$ref": 1, + }, + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 14, }, "variables": Array [ Object { @@ -6469,214 +6388,188 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "a", "range": Array [ - 9, - 10, + 6, + 15, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 18, + 19, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "a", "range": Array [ - 9, - 10, + 6, + 15, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 14, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 65, - ], - "type": "Program", + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "E", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 70, + ], + "type": "TSEnumDeclaration", + }, + "parent": undefined, + "type": "EnumName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "E", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "name": "E", + "references": Array [], + "scope": Object { + "$ref": 14, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/enum-string.ts 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ - 7, - 64, + 0, + 28, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 5, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "BAR", "range": Array [ - 35, - 62, + 15, + 18, ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Decorator", - "range": Array [ - 37, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, + "kind": "w", + "resolved": Object { + "$ref": 1, }, - "variableScope": Object { - "$ref": 5, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "Literal", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "config", - "range": Array [ - 47, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 35, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "config", - "range": Array [ - 47, - 53, - ], - "type": "Identifier", - }, - ], - "name": "config", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, }, ], - "type": "class", + "throughReferences": Array [], + "type": "enum", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object { - "Test": Object { + "BAR": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -6684,39 +6577,43 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Test", + "name": "BAR", "range": Array [ - 13, - 17, + 15, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 64, + 15, + 26, ], - "type": "ClassDeclaration", + "type": "TSEnumMember", }, "parent": undefined, - "type": "ClassName", + "type": "EnumMemberName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Test", + "name": "BAR", "range": Array [ - 13, - 17, + 15, + 18, ], "type": "Identifier", }, ], - "name": "Test", - "references": Array [], + "name": "BAR", + "references": Array [ + Object { + "$ref": 2, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], @@ -6725,22 +6622,19 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 5, }, "variableMap": Object { - "Test": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -6748,39 +6642,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Test", + "name": "Foo", "range": Array [ - 13, - 17, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 64, + 0, + 28, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "ClassName", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Test", + "name": "Foo", "range": Array [ - 13, - 17, + 5, + 8, ], "type": "Identifier", }, ], - "name": "Test", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], @@ -6789,28 +6683,25 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` Object { "$id": 2, "block": Object { "range": Array [ 0, - 115, + 23, ], "type": "Program", }, @@ -6820,82 +6711,59 @@ Object { "block": Object { "range": Array [ 0, - 115, + 23, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 110, - 114, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 110, - 114, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 114, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 110, - 114, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -6905,13 +6773,13 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-as.ts 1`] = ` Object { "$id": 2, "block": Object { "range": Array [ 0, - 28, + 27, ], "type": "Program", }, @@ -6921,76 +6789,59 @@ Object { "block": Object { "range": Array [ 0, - 28, + 27, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 27, - ], - "type": "TSImportEqualsDeclaration", - }, - "parent": null, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7000,261 +6851,279 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` Object { - "$id": 1, + "$id": 17, "block": Object { "range": Array [ 0, - 16, + 67, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 16, "block": Object { "range": Array [ 0, - 16, + 67, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/interface-type.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 143, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 143, - ], - "type": "Program", - }, - "childScopes": Array [ + "references": Array [ Object { - "$id": 5, - "block": Object { + "$id": 6, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", "range": Array [ - 28, - 142, + 32, + 35, ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "text", - "range": Array [ - 116, - 120, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, }, - "variableScope": Object { - "$ref": 5, + "identifier": Object { + "name": "foo", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 2, + "$id": 8, "from": Object { - "$ref": 6, + "$ref": 16, }, "identifier": Object { - "name": "text", + "name": "a", "range": Array [ - 6, - 10, + 37, + 38, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { "$ref": 0, }, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", "range": Array [ - 13, - 19, + 40, + 41, ], - "type": "Literal", + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, }, + "writeExpr": undefined, }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, + Object { + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, - "text": Object { - "$ref": 0, + Object { + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "text", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "d", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 60, + 61, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "f", + "range": Array [ + 63, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object { + "a": Object { + "$ref": 0, + }, + "b": Object { + "$ref": 1, + }, + "c": Object { + "$ref": 2, + }, + "d": Object { + "$ref": 3, + }, + "e": Object { + "$ref": 4, + }, + "f": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 16, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 7, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 20, + 22, ], "type": "VariableDeclaration", }, @@ -7264,25 +7133,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "text", + "name": "a", "range": Array [ 6, - 10, + 7, ], "type": "Identifier", }, ], - "name": "text", + "name": "a", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 4, + "$ref": 8, }, ], "scope": Object { - "$ref": 6, + "$ref": 16, }, }, Object { @@ -7290,347 +7156,124 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "b", "range": Array [ - 37, - 40, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 28, - 142, + 9, + 10, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "FunctionName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "b", "range": Array [ - 37, - 40, + 9, + 10, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "b", + "references": Array [ + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 16, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/method-overload.ts 1`] = ` -Object { - "$id": 11, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 0, - 124, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 9, - "block": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ + "$id": 2, + "defs": Array [ Object { - "$id": 8, - "block": Object { + "name": Object { + "name": "c", "range": Array [ - 73, - 121, + 12, + 13, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, + "node": Object { + "range": Array [ + 12, + 13, + ], + "type": "VariableDeclarator", }, - "variableMap": Object { - "a": Object { - "$ref": 7, - }, - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "s", + "parent": Object { "range": Array [ - 59, - 60, + 0, + 22, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "type": "VariableDeclaration", }, - "writeExpr": undefined, + "type": "Variable", }, ], - "throughReferences": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 5, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", }, ], - "type": "class", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ + "name": "c", + "references": Array [ Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 9, - }, + "$ref": 10, }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 18, - ], - "type": "CallExpression", + "scope": Object { + "$ref": 16, }, }, Object { "$id": 3, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 10, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 10, - }, - "variables": Array [ - Object { - "$id": 0, "defs": Array [ Object { "name": Object { - "name": "s", + "name": "d", "range": Array [ - 6, - 7, + 15, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 18, + 15, + 16, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 18, + 22, ], "type": "VariableDeclaration", }, @@ -7640,65 +7283,122 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "s", + "name": "d", "range": Array [ - 6, - 7, + 15, + 16, ], "type": "Identifier", }, ], - "name": "s", + "name": "d", "references": Array [ Object { - "$ref": 2, - }, - Object { - "$ref": 5, + "$ref": 13, }, ], "scope": Object { - "$ref": 10, + "$ref": 16, }, }, Object { - "$id": 1, + "$id": 4, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "e", "range": Array [ - 25, - 26, + 18, + 19, ], "type": "Identifier", }, "node": Object { "range": Array [ + 18, 19, - 123, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "e", "range": Array [ - 25, - 26, + 18, + 19, ], "type": "Identifier", }, ], - "name": "A", - "references": Array [], + "name": "e", + "references": Array [ + Object { + "$ref": 14, + }, + ], "scope": Object { - "$ref": 10, + "$ref": 16, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "f", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 22, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "f", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + ], + "name": "f", + "references": Array [ + Object { + "$ref": 15, + }, + ], + "scope": Object { + "$ref": 16, }, }, ], @@ -7709,250 +7409,246 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 17, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/namespace.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload.ts 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, - 63, + 101, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ 0, - 63, + 101, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 1, "block": Object { "range": Array [ - 24, - 56, + 0, + 18, ], - "type": "TSModuleBlock", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 47, - 48, - ], - "type": "Literal", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { + "range": Array [ + 19, + 46, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, }, "variableMap": Object { "a": Object { - "$ref": 5, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { - "$id": 5, + "$id": 2, "defs": Array [ Object { "name": Object { "name": "a", "range": Array [ - 43, - 44, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 43, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 37, - 48, + 19, + 46, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, - "type": "Variable", + "parent": null, + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", "range": Array [ - 43, - 44, + 30, + 39, ], "type": "Identifier", }, ], "name": "a", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 3, }, }, ], }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "a", + "$id": 6, + "block": Object { "range": Array [ - 6, - 7, + 47, + 100, ], - "type": "Identifier", + "type": "FunctionDeclaration", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, }, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "N", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", + "variableMap": Object { + "a": Object { + "$ref": 5, + }, + "arguments": Object { + "$ref": 4, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "variableScope": Object { + "$ref": 6, }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 58, + 68, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 58, + 68, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object { - "N": Object { - "$ref": 1, - }, - "a": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 7, }, "variables": Array [ Object { @@ -7960,96 +7656,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 11, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "N", + "name": "f", "range": Array [ - 22, - 23, + 56, + 57, ], "type": "Identifier", }, "node": Object { "range": Array [ - 12, - 56, + 47, + 100, ], - "type": "TSModuleDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "NamespaceName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "N", + "name": "f", "range": Array [ - 22, - 23, + 56, + 57, ], "type": "Identifier", }, ], - "name": "N", - "references": Array [ - Object { - "$ref": 4, - }, - ], + "name": "f", + "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -8060,22 +7699,23 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/rest-element.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 35, + 47, ], "type": "Program", }, @@ -8085,87 +7725,99 @@ Object { "block": Object { "range": Array [ 0, - 35, + 47, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 34, + 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "empty-function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { + "range": Array [ + 19, + 46, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "args": Object { + "a": Object { "$ref": 2, }, - "arguments": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, Object { "$id": 2, "defs": Array [ Object { "name": Object { - "name": "args", + "name": "a", "range": Array [ - 16, - 20, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 34, + 19, + 46, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "args", + "name": "a", "range": Array [ - 16, - 20, + 30, + 39, ], "type": "Identifier", }, ], - "name": "args", + "name": "a", "references": Array [], "scope": Object { "$ref": 3, @@ -8179,11 +7831,12 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "foo": Object { + "f": Object { "$ref": 0, }, }, @@ -8196,19 +7849,19 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "f", "range": Array [ 9, - 12, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 34, + 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "FunctionName", @@ -8217,15 +7870,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "f", "range": Array [ 9, - 12, + 10, ], "type": "Identifier", }, ], - "name": "foo", + "name": "f", "references": Array [], "scope": Object { "$ref": 4, @@ -8239,6 +7892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8248,63 +7902,13 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-alias.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` Object { "$id": 8, "block": Object { "range": Array [ 0, - 103, + 65, ], "type": "Program", }, @@ -8314,7 +7918,7 @@ Object { "block": Object { "range": Array [ 0, - 103, + 65, ], "type": "Program", }, @@ -8323,8 +7927,8 @@ Object { "$id": 6, "block": Object { "range": Array [ - 32, - 102, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -8333,25 +7937,48 @@ Object { "$id": 5, "block": Object { "range": Array [ - 47, - 100, + 35, + 62, ], "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Decorator", + "range": Array [ + 37, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, "variableMap": Object { - "a": Object { - "$ref": 4, - }, "arguments": Object { + "$ref": 2, + }, + "config": Object { "$ref": 3, }, }, @@ -8360,7 +7987,7 @@ Object { }, "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], @@ -8371,21 +7998,21 @@ Object { }, }, Object { - "$id": 4, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "config", "range": Array [ - 48, - 59, + 47, + 53, ], "type": "Identifier", }, "node": Object { "range": Array [ - 47, - 100, + 35, + 62, ], "type": "FunctionExpression", }, @@ -8396,15 +8023,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "config", "range": Array [ - 48, - 59, + 47, + 53, ], "type": "Identifier", }, ], - "name": "a", + "name": "config", "references": Array [], "scope": Object { "$ref": 5, @@ -8416,14 +8043,19 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, "variableMap": Object { - "C": Object { - "$ref": 2, + "Test": Object { + "$ref": 1, }, }, "variableScope": Object { @@ -8431,21 +8063,21 @@ Object { }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Test", "range": Array [ - 38, - 39, + 13, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 102, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -8456,15 +8088,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Test", "range": Array [ - 38, - 39, + 13, + 17, ], "type": "Identifier", }, ], - "name": "C", + "name": "Test", "references": Array [], "scope": Object { "$ref": 6, @@ -8476,16 +8108,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, "variableMap": Object { - "C": Object { - "$ref": 1, - }, - "a": Object { + "Test": Object { "$ref": 0, }, }, @@ -8498,82 +8132,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "Test", "range": Array [ - 20, - 31, + 13, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 31, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 16, - 31, + 7, + 64, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "Test", "range": Array [ - 20, - 31, + 13, + 17, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - ], - "name": "C", + "name": "Test", "references": Array [], "scope": Object { "$ref": 7, @@ -8585,8 +8173,13 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8596,240 +8189,265 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 5, + "$id": 14, "block": Object { "range": Array [ 0, - 40, + 115, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 13, "block": Object { "range": Array [ 0, - 40, + 115, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", + "$id": 5, + "block": Object { "range": Array [ - 17, - 18, + 0, + 15, ], - "type": "Identifier", + "type": "TSTypeAliasDeclaration", }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "TSTypeAssertion", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, }, + "variables": Array [], }, Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", + "$id": 7, + "block": Object { "range": Array [ - 25, - 26, + 16, + 44, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], }, Object { - "$id": 2, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", + "$id": 12, + "block": Object { "range": Array [ - 28, - 29, + 45, + 104, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 32, - 38, - ], - "type": "TSAsExpression", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 65, + 66, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 80, + 91, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 88, + 89, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 99, + 100, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 13, }, "identifier": Object { - "name": "b", + "name": "C", "range": Array [ - 32, - 33, + 113, + 114, ], "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { + "$ref": 9, + }, + ], + "type": "module", + "typeMap": Object { + "A": Object { "$ref": 0, }, - Object { + "B": Object { "$ref": 1, }, - Object { + "C": Object { "$ref": 2, }, - Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 14, }, "variableMap": Object { - "f": Object { - "$ref": 0, + "a": Object { + "$ref": 3, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 13, }, "variables": Array [ Object { @@ -8837,170 +8455,183 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "A", "range": Array [ - 9, - 10, + 5, + 6, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 18, + 15, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "A", "range": Array [ - 9, - 10, + 5, + 6, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 13, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 37, - ], - "type": "JSXElement", - }, - }, - ], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "B", "range": Array [ - 6, - 7, + 26, + 27, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 37, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 38, + 16, + 44, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "B", "range": Array [ - 6, - 7, + 26, + 27, ], "type": "Identifier", }, ], - "name": "a", + "name": "B", "references": Array [ Object { - "$ref": 1, + "$ref": 8, }, ], "scope": Object { - "$ref": 2, + "$ref": 13, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 45, + 104, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 110, + 114, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 110, + 114, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 106, + 114, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 110, + 114, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 13, }, }, ], @@ -9009,98 +8640,59 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 9, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 14, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-equals.ts 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 43, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 43, + 28, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 2, }, "variableMap": Object { - "obj": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [ Object { @@ -9108,52 +8700,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, 7, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 27, ], - "type": "VariableDeclaration", + "type": "TSImportEqualsDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, 7, + 10, ], "type": "Identifier", }, ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "name": "foo", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 1, }, }, ], @@ -9164,303 +8743,75 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` Object { - "$id": 9, + "$id": 1, "block": Object { "range": Array [ 0, - 63, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 0, "block": Object { "range": Array [ 0, - 63, + 16, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 27, - 40, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 46, - 61, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 46, - 47, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 1, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/interface-type.ts 1`] = ` Object { "$id": 9, "block": Object { "range": Array [ 0, - 165, + 67, ], "type": "Program", }, @@ -9470,164 +8821,215 @@ Object { "block": Object { "range": Array [ 0, - 165, + 67, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", + "$id": 3, + "block": Object { "range": Array [ - 6, - 9, + 0, + 25, ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "type": "TSInterfaceDeclaration", }, - "writeExpr": Object { - "range": Array [ - 12, - 24, - ], - "type": "ObjectExpression", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, }, - }, - Object { - "$id": 2, - "from": Object { + "upperScope": Object { "$ref": 8, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 76, - 79, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 95, - 98, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 11, + 20, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", + "$id": 7, + "block": Object { "range": Array [ - 125, - 128, + 27, + 66, ], - "type": "Identifier", + "type": "TSInterfaceDeclaration", }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 63, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 4, + }, }, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { + "upperScope": Object { "$ref": 8, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 140, - 143, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { + "variableMap": Object {}, + "variableScope": Object { "$ref": 8, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 159, - 162, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 38, + 51, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "obj": Object { + "typeMap": Object { + "C": Object { "$ref": 0, }, + "R": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 9, }, + "variableMap": Object {}, "variableScope": Object { "$ref": 8, }, @@ -9637,65 +9039,84 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "C", "range": Array [ - 6, - 9, + 10, + 11, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 24, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 24, + 25, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "C", "range": Array [ - 6, - 9, + 10, + 11, ], "type": "Identifier", }, ], - "name": "obj", + "name": "C", "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, Object { "$ref": 5, }, Object { "$ref": 6, }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { - "$ref": 7, + "name": Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 66, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", }, ], + "name": "R", + "references": Array [], "scope": Object { "$ref": 8, }, @@ -9708,6 +9129,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9717,33 +9139,33 @@ Object { } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-return-type.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, - 83, + 143, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, - 83, + 143, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ - 0, - 82, + 28, + 142, ], "type": "FunctionDeclaration", }, @@ -9752,95 +9174,53 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { - "name": "a", + "name": "text", "range": Array [ - 30, - 31, + 116, + 120, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 0, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { - "a": Object { - "$ref": 2, - }, "arguments": Object { - "$ref": 1, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { - "$id": 1, + "$id": 3, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -9848,19 +9228,49 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "text", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 13, + 19, + ], + "type": "Literal", + }, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "f": Object { + "Foo": Object { + "$ref": 1, + }, + "text": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -9868,17 +9278,70 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "text", "range": Array [ - 9, + 6, 10, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 82, + 20, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "text", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + ], + "name": "text", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 28, + 142, ], "type": "FunctionDeclaration", }, @@ -9889,18 +9352,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "Foo", "range": Array [ - 9, - 10, + 37, + 40, ], "type": "Identifier", }, ], - "name": "f", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -9911,139 +9374,232 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/method-overload.ts 1`] = ` Object { - "$id": 6, + "$id": 12, "block": Object { "range": Array [ 0, - 62, + 124, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 11, "block": Object { "range": Array [ 0, - 62, + 124, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 10, "block": Object { "range": Array [ - 0, - 61, + 19, + 123, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 73, + 121, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "a": Object { + "$ref": 8, + }, + "arguments": Object { + "$ref": 7, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 74, + 81, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 73, + 121, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 74, + 81, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 10, }, "identifier": Object { - "name": "g", + "name": "a", "range": Array [ - 28, - 29, + 49, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 59, + 60, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 0, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "function", + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 11, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "g": Object { - "$ref": 2, + "A": Object { + "$ref": 4, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 11, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, + "$id": 4, "defs": Array [ Object { "name": Object { - "name": "g", + "name": "A", "range": Array [ - 31, - 35, + 25, + 26, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 61, + 19, + 123, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "g", + "name": "A", "range": Array [ - 31, - 35, + 25, + 26, ], "type": "Identifier", }, ], - "name": "g", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "name": "A", + "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 10, }, }, ], @@ -10051,19 +9607,73 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 18, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 12, }, "variableMap": Object { - "g": Object { + "A": Object { + "$ref": 1, + }, + "s": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 11, }, "variables": Array [ Object { @@ -10071,39 +9681,92 @@ Object { "defs": Array [ Object { "name": Object { - "name": "g", + "name": "s", "range": Array [ - 9, - 10, + 6, + 7, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 18, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 61, + 18, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "s", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 123, + ], + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "g", + "name": "A", "range": Array [ - 9, - 10, + 25, + 26, ], "type": "Identifier", }, ], - "name": "g", + "name": "A", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 11, }, }, ], @@ -10112,34 +9775,42 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 12, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/mixed-variable-ref.ts 1`] = ` Object { - "$id": 12, + "$id": 5, "block": Object { "range": Array [ 0, - 147, + 32, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 4, "block": Object { "range": Array [ 0, - 147, + 32, ], "type": "Program", }, @@ -10148,15 +9819,15 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 11, + "$ref": 4, }, "identifier": Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, - 7, + 6, + 9, ], "type": "Identifier", }, @@ -10166,166 +9837,67 @@ Object { }, "writeExpr": Object { "range": Array [ - 10, - 22, + 12, + 13, ], - "type": "ObjectExpression", + "type": "Literal", }, }, Object { - "$id": 5, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 4, }, "identifier": Object { - "name": "obj2", + "name": "foo", "range": Array [ + 24, 27, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 46, - 58, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 40, - 43, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 87, - 99, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 8, + "$id": 3, "from": Object { - "$ref": 11, + "$ref": 4, }, "identifier": Object { - "name": "obj", + "name": "test", "range": Array [ - 81, - 84, + 19, + 23, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 9, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 132, - 146, - ], - "type": "ArrayExpression", - }, + "$ref": 2, }, Object { - "$id": 10, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 123, - 126, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "$ref": 3, }, ], - "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 5, }, "variableMap": Object { - "element": Object { - "$ref": 3, - }, - "obj": Object { + "foo": Object { "$ref": 0, }, - "obj2": Object { - "$ref": 1, - }, - "value": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 11, + "$ref": 4, }, "variables": Array [ Object { @@ -10333,24 +9905,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, - 7, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 22, + 6, + 13, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, + 14, ], "type": "VariableDeclaration", }, @@ -10360,181 +9932,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "foo", "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 58, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 23, - 58, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - ], - "name": "obj2", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 63, - 99, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 59, - 99, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - ], - "name": "value", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 104, - 146, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 100, - 146, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "element", - "range": Array [ - 105, - 112, + 6, + 9, ], "type": "Identifier", }, ], - "name": "element", + "name": "foo", "references": Array [ Object { - "$ref": 9, + "$ref": 1, }, ], "scope": Object { - "$ref": 11, + "$ref": 4, }, }, ], @@ -10543,204 +9956,258 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 2, + }, + Object { + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/namespace.ts 1`] = ` Object { - "$id": 2, + "$id": 10, "block": Object { "range": Array [ 0, - 49, + 63, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ 0, - 49, + 63, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", + "$id": 8, + "block": Object { + "range": Array [ + 24, + 56, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", "range": Array [ - 4, - 47, + 43, + 44, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { "range": Array [ - 4, 47, + 48, ], - "type": "VariableDeclarator", + "type": "Literal", }, - "parent": Object { + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", "range": Array [ - 0, - 48, + 53, + 54, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "a": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ Object { - "name": "x", - "range": Array [ - 4, - 47, + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 48, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 37, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 11, + ], + "type": "Literal", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "N", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 10, }, "variableMap": Object { - "x": Object { + "N": Object { + "$ref": 1, + }, + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 9, }, "variables": Array [ Object { @@ -10748,24 +10215,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "a", "range": Array [ - 4, - 45, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 45, + 6, + 11, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 46, + 11, ], "type": "VariableDeclaration", }, @@ -10775,18 +10242,69 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "a", "range": Array [ - 4, - 45, + 6, + 7, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 9, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "N", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 12, + 56, + ], + "type": "TSModuleDeclaration", + }, + "parent": null, + "type": "NamespaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "N", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + ], + "name": "N", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 9, }, }, ], @@ -10797,51 +10315,138 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/rest-element.ts 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 13, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 13, + 35, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "args": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "args", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 34, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "args", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + ], + "name": "args", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "x": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -10849,45 +10454,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "foo", "range": Array [ - 4, - 11, + 9, + 12, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 12, + 34, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "foo", "range": Array [ - 4, - 11, + 9, + 12, ], "type": "Identifier", }, ], - "name": "x", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -10898,151 +10497,79 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-infer.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 147, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 147, + 18, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -11050,45 +10577,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "map", + "name": "foo", "range": Array [ - 4, - 35, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 35, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 36, + 17, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "foo", "range": Array [ - 4, - 35, + 5, + 8, ], "type": "Identifier", }, ], - "name": "map", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -11099,152 +10620,314 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` Object { - "$id": 2, + "$id": 13, "block": Object { "range": Array [ 0, - 47, + 103, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 12, "block": Object { "range": Array [ 0, - 47, + 103, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 11, + "block": Object { + "range": Array [ + 32, + 102, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "map", - "range": Array [ - 4, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 45, - ], - "type": "VariableDeclarator", - }, - "parent": Object { + "$id": 10, + "block": Object { "range": Array [ - 0, - 46, + 47, + 100, ], - "type": "VariableDeclaration", + "type": "FunctionExpression", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "map", - "range": Array [ - 4, - 45, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, ], - "type": "Identifier", - }, - ], - "name": "map", - "references": Array [], - "scope": Object { - "$ref": 1, + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "a": Object { + "$ref": 7, + }, + "arguments": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 6, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + Object { + "$id": 7, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 48, + 59, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 48, + 59, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "C": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 12, }, + "variables": Array [ + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 32, + 102, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 48, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 2, + "$ref": 13, }, "variableMap": Object { - "map": Object { - "$ref": 0, + "C": Object { + "$ref": 2, + }, + "a": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 12, }, "variables": Array [ Object { @@ -11252,125 +10935,74 @@ Object { "defs": Array [ Object { "name": Object { - "name": "map", + "name": "A", "range": Array [ - 4, - 46, + 5, + 6, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 46, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 47, + 15, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "A", "range": Array [ - 4, - 46, + 5, + 6, ], "type": "Identifier", }, ], - "name": "map", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 12, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-plus.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "map": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "map", + "name": "a", "range": Array [ - 4, - 47, + 20, + 31, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 47, + 20, + 31, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 0, - 48, + 16, + 31, ], "type": "VariableDeclaration", }, @@ -11380,18 +11012,58 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "map", + "name": "a", "range": Array [ - 4, - 47, + 20, + 31, ], "type": "Identifier", }, ], - "name": "map", + "name": "a", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 32, + 102, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 12, }, }, ], @@ -11402,151 +11074,211 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 81, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 13, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ 0, - 29, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 8, "block": Object { "range": Array [ 0, - 29, + 40, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 10, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "TSTypeAssertion", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 32, + 38, + ], + "type": "TSAsExpression", + }, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "A": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [ Object { @@ -11554,45 +11286,46 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "A", "range": Array [ - 4, - 8, + 5, + 6, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 8, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 9, + 16, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "A", "range": Array [ - 4, - 8, + 5, + 6, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 6, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 8, }, }, ], @@ -11601,154 +11334,154 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 9, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 22, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 22, + 19, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 4, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 4, - 20, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 21, - ], - "type": "VariableDeclaration", + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, }, - "type": "Variable", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "x", - "range": Array [ - 4, - 20, + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 13, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic-nested.src.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "x": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -11756,45 +11489,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "f", "range": Array [ - 4, - 27, + 9, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 28, + 18, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "f", "range": Array [ - 4, - 27, + 9, + 10, ], "type": "Identifier", }, ], - "name": "x", + "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -11805,51 +11532,100 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 33, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 33, + 39, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 37, + ], + "type": "JSXElement", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "TypeA", + "range": Array [ + 28, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { - "x": Object { + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -11857,24 +11633,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "a", "range": Array [ - 4, - 31, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 31, + 6, + 37, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 32, + 38, ], "type": "VariableDeclaration", }, @@ -11884,18 +11660,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "a", "range": Array [ - 4, - 31, + 6, + 7, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -11904,53 +11684,127 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-empty.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typed-this.src.ts 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 11, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 11, + 31, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "String", + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { - "x": Object { + "test": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -11958,45 +11812,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "test", "range": Array [ - 4, 9, + 13, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 10, + 30, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "test", "range": Array [ - 4, 9, + 13, ], "type": "Identifier", }, ], - "name": "x", + "name": "test", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -12005,53 +11853,139 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-optional.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof.ts 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, - 45, + 43, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 45, + 43, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 23, + 42, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 22, + ], + "type": "ObjectExpression", + }, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "B": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { - "x": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -12059,24 +11993,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "obj", "range": Array [ 4, - 44, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 44, + 22, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 44, + 22, ], "type": "VariableDeclaration", }, @@ -12086,73 +12020,279 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "obj", "range": Array [ 4, - 44, + 7, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 5, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 23, + 42, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-rest.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` Object { - "$id": 2, + "$id": 9, "block": Object { "range": Array [ 0, - 29, + 63, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, - 29, + 63, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 22, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 27, + 40, + ], + "type": "TSTypeAssertion", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 46, + 61, + ], + "type": "TSAsExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 46, + 47, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 58, + 61, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 9, }, "variableMap": Object { - "x": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [ Object { @@ -12160,24 +12300,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "obj", "range": Array [ 4, - 28, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 28, + 22, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 28, + 22, ], "type": "VariableDeclaration", }, @@ -12187,18 +12327,28 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "obj", "range": Array [ 4, - 28, + 7, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 1, + "$ref": 8, }, }, ], @@ -12207,490 +12357,468 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 9, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-literal.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` Object { - "$id": 2, + "$id": 18, "block": Object { "range": Array [ 0, - 24, + 165, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 17, "block": Object { "range": Array [ 0, - 24, + 165, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "obj": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 16, + "block": Object { + "range": Array [ + 25, + 164, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { + "$id": 4, + "from": Object { + "$ref": 16, + }, + "identifier": Object { "name": "obj", "range": Array [ - 4, - 22, + 61, + 64, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": Object { + "$ref": 0, }, - "parent": Object { + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", "range": Array [ - 0, - 23, + 66, + 79, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 22, - ], - "type": "Identifier", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "name": "obj", - "references": Array [], - "scope": Object { - "$ref": 1, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-operator.src.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 38, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ Object { - "name": Object { - "name": "x", + "$id": 6, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 4, - 14, + 76, + 79, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": Object { + "$ref": 0, }, - "parent": Object { + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", "range": Array [ - 0, - 15, + 81, + 85, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "x", - "range": Array [ - 4, - 14, - ], - "type": "Identifier", + "$id": 8, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 84, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ Object { - "name": Object { - "name": "y", + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 20, - 36, + 95, + 98, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 20, - 36, + 125, + 128, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", "range": Array [ - 16, - 37, + 130, + 143, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "y", - "range": Array [ - 20, - 36, - ], - "type": "Identifier", + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 140, + 143, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-typeof.src.ts 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ Object { - "name": Object { - "name": "x", + "$id": 13, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", "range": Array [ - 4, - 17, + 145, + 149, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "T", "range": Array [ - 4, - 17, + 148, + 149, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 0, - 18, + 159, + 162, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "x", - "range": Array [ - 4, - 17, - ], - "type": "Identifier", + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 15, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 17, }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 65, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "T", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 107, + 129, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$ref": 16, + }, + }, + ], }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-intersection.src.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 161, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 24, + ], + "type": "ObjectExpression", + }, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 5, + "$ref": 18, }, "variableMap": Object { - "intersection": Object { - "$ref": 1, - }, - "precedence1": Object { - "$ref": 2, - }, - "precedence2": Object { - "$ref": 3, - }, - "union": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 17, }, "variables": Array [ Object { @@ -12698,24 +12826,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "union", + "name": "obj", "range": Array [ - 4, - 36, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 36, + 6, + 24, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 37, + 24, ], "type": "VariableDeclaration", }, @@ -12725,18 +12853,40 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "union", + "name": "obj", "range": Array [ - 4, - 36, + 6, + 9, ], "type": "Identifier", }, ], - "name": "union", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 15, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 17, }, }, Object { @@ -12744,137 +12894,258 @@ Object { "defs": Array [ Object { "name": Object { - "name": "intersection", + "name": "A", "range": Array [ - 42, - 71, + 35, + 36, ], "type": "Identifier", }, "node": Object { "range": Array [ - 42, - 71, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 38, - 72, + 25, + 164, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, - "type": "Variable", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "intersection", + "name": "A", "range": Array [ - 42, - 71, + 35, + 36, ], "type": "Identifier", }, ], - "name": "intersection", + "name": "A", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 17, }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 18, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-return-type.ts 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 83, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 83, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 2, - "defs": Array [ + "$id": 4, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "precedence1", - "range": Array [ - 77, - 115, - ], - "type": "Identifier", + "$id": 3, + "from": Object { + "$ref": 4, }, - "node": Object { + "identifier": Object { + "name": "a", "range": Array [ - 77, - 115, + 30, + 31, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { - "range": Array [ - 73, - 116, - ], - "type": "VariableDeclaration", + "kind": "r", + "resolved": Object { + "$ref": 2, }, - "type": "Variable", + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ Object { - "name": "precedence1", - "range": Array [ - 77, - 115, + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 11, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 11, + 20, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, }, ], - "name": "precedence1", - "references": Array [], - "scope": Object { - "$ref": 4, - }, }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ Object { - "$id": 3, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "precedence2", + "name": "f", "range": Array [ - 121, - 159, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 121, - 159, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 117, - 160, + 0, + 82, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "precedence2", + "name": "f", "range": Array [ - 121, - 159, + 9, + 10, ], "type": "Identifier", }, ], - "name": "precedence2", + "name": "f", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -12885,49 +13156,272 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, - 27, + 62, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 7, "block": Object { "range": Array [ 0, - 27, + 62, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 61, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "g", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "g": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 30, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "g", + "range": Array [ + 31, + 35, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 61, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "g", + "range": Array [ + 31, + 35, + ], + "type": "Identifier", + }, + ], + "name": "g", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 1, + "$ref": 8, + }, + "variableMap": Object { + "g": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 7, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "g", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 61, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "g", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + ], + "name": "g", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -12935,200 +13429,456 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/535.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` Object { - "$id": 5, + "$id": 12, "block": Object { "range": Array [ 0, - 52, + 147, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 11, "block": Object { "range": Array [ 0, - 51, + 147, ], - "type": "FunctionDeclaration", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 11, }, "identifier": Object { - "name": "bar", + "name": "obj", "range": Array [ - 45, - 48, + 4, + 7, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 0, }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", + "writeExpr": Object { + "range": Array [ + 10, + 22, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj2", + "range": Array [ + 27, + 43, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 46, + 58, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "value", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": Object { + "range": Array [ + 87, + 99, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 132, + 146, + ], + "type": "ArrayExpression", + }, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 123, + 126, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 12, }, "variableMap": Object { - "arguments": Object { + "element": Object { + "$ref": 3, + }, + "obj": Object { + "$ref": 0, + }, + "obj2": Object { "$ref": 1, }, - "bar": Object { + "value": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 11, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], + "identifiers": Array [ + Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + ], + "name": "obj", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 11, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "obj2", "range": Array [ - 15, - 18, + 27, + 43, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 51, + 27, + 58, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "Parameter", + "parent": Object { + "range": Array [ + 23, + 58, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", + "name": "obj2", "range": Array [ - 15, - 18, + 27, + 43, ], "type": "Identifier", }, ], - "name": "bar", + "name": "obj2", "references": Array [ Object { - "$ref": 3, + "$ref": 5, }, ], "scope": Object { - "$ref": 4, + "$ref": 11, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "value", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 63, + 99, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 59, + 99, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "value", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + ], + "name": "value", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 11, }, - "parent": null, - "type": "FunctionName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "foo", - "range": Array [ - 9, - 12, + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 104, + 146, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 100, + 146, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + ], + "name": "element", + "references": Array [ + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 11, + }, }, ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/abstract-class.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 69, + 20, ], "type": "Program", }, @@ -13138,63 +13888,90 @@ Object { "block": Object { "range": Array [ 0, - 68, + 20, ], - "type": "ClassDeclaration", + "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { "$ref": 3, }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "Foo", "range": Array [ - 15, - 16, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 68, + 19, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "Foo", "range": Array [ - 15, - 16, + 5, + 8, ], "type": "Identifier", }, ], - "name": "A", + "name": "Foo", "references": Array [], "scope": Object { "$ref": 2, @@ -13208,136 +13985,202 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { "$ref": 3, }, - "variables": Array [ + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 68, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "name": "A", - "range": Array [ - 15, - 16, + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, }, ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 3, - }, }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-implements.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 83, + 47, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 1, "block": Object { "range": Array [ 0, - 82, + 47, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 2, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "x": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "x", "range": Array [ - 6, - 9, + 4, + 45, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 82, + 46, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": undefined, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "x", "range": Array [ - 6, - 9, + 4, + 45, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 1, }, }, ], @@ -13348,182 +14191,141 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-properties.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` Object { - "$id": 8, + "$id": 4, "block": Object { "range": Array [ 0, - 63, + 13, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ - 19, - 62, + 0, + 13, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 1, "from": Object { - "$ref": 7, + "$ref": 3, }, "identifier": Object { - "name": "s", + "name": "K", "range": Array [ - 43, - 44, + 9, + 10, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 2, "from": Object { - "$ref": 7, + "$ref": 3, }, "identifier": Object { - "name": "s", + "name": "T", "range": Array [ - 50, - 51, + 7, + 8, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, ], "throughReferences": Array [ Object { - "$ref": 5, + "$ref": 1, }, Object { - "$ref": 6, + "$ref": 2, }, ], - "type": "class", + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 4, }, "variableMap": Object { - "A": Object { - "$ref": 4, - }, + "x": Object { + "$ref": 0, + }, }, "variableScope": Object { - "$ref": 8, + "$ref": 3, }, "variables": Array [ Object { - "$id": 4, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "A", + "name": "x", "range": Array [ - 25, - 26, + 4, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ - 19, - 62, + 4, + 11, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "x", "range": Array [ - 25, - 26, + 4, + 11, ], "type": "Identifier", }, ], - "name": "A", + "name": "x", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 3, }, }, ], @@ -13531,443 +14333,435 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 18, - ], - "type": "CallExpression", - }, - }, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 10, - 16, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "$ref": 1, }, - ], - "throughReferences": Array [ Object { - "$ref": 3, + "$ref": 2, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - "s": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "s", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-supper-type.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-infer.ts 1`] = ` Object { - "$id": 12, + "$id": 15, "block": Object { "range": Array [ 0, - 117, + 147, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 14, "block": Object { "range": Array [ 0, - 40, + 147, ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 12, + "type": "Program", }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 6, - "defs": Array [ + "$id": 13, + "block": Object { + "range": Array [ + 0, + 146, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "Foo", + "$id": 2, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 15, - 18, + 23, + 24, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 0, - 40, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 40, + 41, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", + "$id": 4, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - Object { - "$id": 9, - "block": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo2": Object { - "$ref": 8, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 8, - "defs": Array [ Object { - "name": Object { - "name": "Foo2", + "$id": 5, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 56, + 59, 60, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 42, - 82, + 75, + 76, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 79, + 80, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "name": "Foo2", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - Object { - "$id": 11, - "block": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Foo3": Object { - "$ref": 10, - }, - }, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [ - Object { - "$id": 10, - "defs": Array [ Object { - "name": Object { - "name": "Foo3", + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 90, - 94, + 95, + 96, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "Promise", "range": Array [ - 84, - 116, + 105, + 112, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "parent": undefined, - "type": "ClassName", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 119, + 120, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "name": "Foo3", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 12, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 69, - 72, - ], - "type": "Identifier", + Object { + "$id": 11, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 124, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 144, + 145, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "module", + "typeMap": Object { + "Unpacked": Object { + "$ref": 0, + }, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 12, + "upperScope": Object { + "$ref": 15, }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Unpacked", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 146, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Unpacked", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Unpacked", + "references": Array [], + "scope": Object { + "$ref": 14, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], "throughReferences": Array [ Object { "$ref": 3, @@ -13976,764 +14770,378 @@ Object { "$ref": 4, }, Object { - "$ref": 5, + "$ref": 6, }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, + Object { + "$ref": 7, }, - "Foo2": Object { - "$ref": 1, + Object { + "$ref": 9, }, - "Foo3": Object { - "$ref": 2, + Object { + "$ref": 10, }, - }, + Object { + "$ref": 11, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 15, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 40, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 42, - 82, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo2", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - ], - "name": "Foo2", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 84, - 116, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo3", - "range": Array [ - 90, - 94, - ], - "type": "Identifier", - }, - ], - "name": "Foo3", - "references": Array [], - "scope": Object { - "$ref": 12, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 110, + 50, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, + "childScopes": Array [ Object { "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 54, - 56, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", + "block": Object { "range": Array [ - 71, - 73, + 0, + 50, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "type": "Program", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + "childScopes": Array [ Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - "parent": Object { + "$id": 5, + "block": Object { "range": Array [ 0, - 34, + 49, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s1", - "range": Array [ - 6, - 8, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "LinkedList", + "range": Array [ + 33, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, ], - "type": "Identifier", - }, - ], - "name": "s1", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, }, - "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", + "upperScope": Object { + "$ref": 6, }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s2", - "range": Array [ - 21, - 23, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, ], - "type": "Identifier", }, ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "LinkedList": Object { + "$ref": 0, }, - ], - "scope": Object { - "$ref": 8, }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` -Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 107, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 8, + "upperScope": Object { + "$ref": 7, }, - "identifier": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 11, - 19, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 11, - 17, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 26, - 34, - ], - "type": "CallExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "Symbol", - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s1", - "range": Array [ - 51, - 53, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "s2", - "range": Array [ - 68, - 70, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + ], + "name": "LinkedList", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "s1": Object { - "$ref": 0, - }, - "s2": Object { - "$ref": 1, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, - "variables": Array [ + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 2, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", + "$id": 1, + "from": Object { + "$ref": 2, }, - "parent": Object { + "identifier": Object { + "name": "P", "range": Array [ - 0, - 34, + 12, + 13, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "s1", - "range": Array [ - 6, - 8, - ], - "type": "Identifier", + "$ref": 1, }, ], - "name": "s1", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s2", - "range": Array [ - 21, - 23, - ], - "type": "Identifier", - }, - ], - "name": "s2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "map": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { - "$id": 2, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "map", "range": Array [ - 19, - 28, + 4, + 35, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 35, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 37, + 36, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, - "parent": null, - "type": "Parameter", + "type": "Variable", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "map", "range": Array [ - 19, - 28, + 4, + 35, ], "type": "Identifier", }, ], - "name": "a", + "name": "map", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -14741,187 +15149,128 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "references": Array [ + "references": Array [], + "throughReferences": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "f", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 70, + 47, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 69, + 47, ], - "type": "TSDeclareFunction", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { - "name": "subject", + "name": "P", "range": Array [ - 61, - 68, + 21, + 22, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 1, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "empty-function", + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "subject": Object { - "$ref": 1, + "map": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "subject", + "name": "map", "range": Array [ - 27, - 51, + 4, + 45, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 69, + 46, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, - "parent": null, - "type": "Parameter", + "type": "Variable", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "subject", + "name": "map", "range": Array [ - 27, - 51, + 4, + 45, ], "type": "Identifier", }, ], - "name": "subject", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "map", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -14930,252 +15279,106 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "eachr": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "eachr", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 69, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "eachr", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - ], - "name": "eachr", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-global.ts 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 55, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "throughReferences": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "type": "Literal", - }, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 21, - 34, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 25, - 34, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-module.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 95, + 48, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ - 33, - 92, + 0, + 48, ], - "type": "TSModuleBlock", + "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": false, + "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 1, "from": Object { - "$ref": 6, + "$ref": 2, }, "identifier": Object { - "name": "a", + "name": "P", "range": Array [ - 89, - 90, + 22, + 23, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 3, - }, + "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "block", + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 3, }, "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "b": Object { - "$ref": 4, + "map": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 2, }, "variables": Array [ Object { - "$id": 3, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "map", "range": Array [ - 52, - 61, + 4, + 46, ], "type": "Identifier", }, "node": Object { "range": Array [ - 52, - 61, + 4, + 46, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 46, - 61, + 0, + 47, ], "type": "VariableDeclaration", }, @@ -15185,47 +15388,126 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "map", "range": Array [ - 52, - 61, + 4, + 46, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 5, - }, - ], + "name": "map", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-mapped-readonly-plus.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 4, + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "map": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "b", + "name": "map", "range": Array [ - 79, - 90, + 4, + 47, ], "type": "Identifier", }, "node": Object { "range": Array [ - 79, - 90, + 4, + 47, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 73, - 90, + 0, + 48, ], "type": "VariableDeclaration", }, @@ -15235,18 +15517,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "b", + "name": "map", "range": Array [ - 79, - 90, + 4, + 47, ], "type": "Identifier", }, ], - "name": "b", + "name": "map", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, }, }, ], @@ -15254,247 +15536,109 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 11, - ], - "type": "Literal", - }, - }, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 93, - 94, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 3, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 11, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 65, + 81, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ - 15, - 64, + 0, + 81, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ - 40, - 62, + 0, + 80, ], - "type": "FunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { + "throughReferences": Array [], + "type": "module", + "typeMap": Object { "Foo": Object { - "$ref": 1, + "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { "name": "Foo", "range": Array [ - 21, - 24, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 0, + 80, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -15502,8 +15646,8 @@ Object { Object { "name": "Foo", "range": Array [ - 21, - 24, + 5, + 8, ], "type": "Identifier", }, @@ -15511,7 +15655,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -15520,252 +15664,246 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 65, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ - 15, - 64, + 0, + 29, ], - "type": "ClassDeclaration", + "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ - 40, - 62, + 0, + 28, ], - "type": "FunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", + "name": Object { + "name": "Foo", "range": Array [ - 42, - 45, + 5, + 8, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", }, ], - "throughReferences": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 4, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", }, ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 46, - 58, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], }, ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 10, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 10, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], - "type": "class", + "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 3, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "x": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "x", "range": Array [ - 21, - 24, + 4, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 4, + 8, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 9, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "x", "range": Array [ - 21, - 24, + 4, + 8, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "x", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 2, }, }, ], @@ -15776,18 +15914,8009 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 20, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 21, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 20, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-reference-generic-nested.src.ts 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 13, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 27, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 27, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 27, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 33, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 33, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 31, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 31, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 32, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 31, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-empty.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 11, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 11, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 10, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 9, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-optional.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-rest.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 28, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-literal.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 24, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 24, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "obj": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "obj", + "range": Array [ + 4, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 23, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "obj", + "range": Array [ + 4, + 22, + ], + "type": "Identifier", + }, + ], + "name": "obj", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-type-operator.src.ts 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + "y": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 14, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "y", + "range": Array [ + 20, + 36, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 36, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 16, + 37, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "y", + "range": Array [ + 20, + 36, + ], + "type": "Identifier", + }, + ], + "name": "y", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-typeof.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "y", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 17, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 17, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-intersection.src.ts 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 161, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 161, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "intersection": Object { + "$ref": 1, + }, + "precedence1": Object { + "$ref": 2, + }, + "precedence2": Object { + "$ref": 3, + }, + "union": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "union", + "range": Array [ + 4, + 36, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 36, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 37, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "union", + "range": Array [ + 4, + 36, + ], + "type": "Identifier", + }, + ], + "name": "union", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "intersection", + "range": Array [ + 42, + 71, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 42, + 71, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 38, + 72, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "intersection", + "range": Array [ + 42, + 71, + ], + "type": "Identifier", + }, + ], + "name": "intersection", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "precedence1", + "range": Array [ + 77, + 115, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 77, + 115, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 73, + 116, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "precedence1", + "range": Array [ + 77, + 115, + ], + "type": "Identifier", + }, + ], + "name": "precedence1", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "precedence2", + "range": Array [ + 121, + 159, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 121, + 159, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 117, + 160, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "precedence2", + "range": Array [ + 121, + 159, + ], + "type": "Identifier", + }, + ], + "name": "precedence2", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: module tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/535.ts 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 52, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 51, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 45, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "bar": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 51, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 51, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/abstract-class.ts 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 69, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 68, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 68, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 68, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-implements.ts 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 83, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Component", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Nullable", + "range": Array [ + 41, + 49, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "SomeOther", + "range": Array [ + 50, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Component2", + "range": Array [ + 67, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "class", + "typeMap": Object { + "Nullable": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Nullable", + "range": Array [ + 10, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Nullable", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-properties.ts 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 63, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 19, + 62, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "A": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 62, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 18, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + "s": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 18, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "s", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 62, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-supper-type.ts 1`] = ` +Object { + "$id": 15, + "block": Object { + "range": Array [ + 0, + 117, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 40, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 42, + 82, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 10, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo2": Object { + "$ref": 9, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 9, + "defs": Array [ + Object { + "name": Object { + "name": "Foo2", + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 42, + 82, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo2", + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + }, + ], + "name": "Foo2", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + Object { + "$id": 14, + "block": Object { + "range": Array [ + 84, + 116, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "Baz", + "range": Array [ + 107, + 110, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "Foo3": Object { + "$ref": 12, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 12, + "defs": Array [ + Object { + "name": Object { + "name": "Foo3", + "range": Array [ + 90, + 94, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 84, + 116, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo3", + "range": Array [ + 90, + 94, + ], + "type": "Identifier", + }, + ], + "name": "Foo3", + "references": Array [], + "scope": Object { + "$ref": 14, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 69, + 72, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 15, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 13, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + "Foo2": Object { + "$ref": 1, + }, + "Foo3": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 40, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 15, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo2", + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 42, + 82, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo2", + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + }, + ], + "name": "Foo2", + "references": Array [], + "scope": Object { + "$ref": 15, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Foo3", + "range": Array [ + 90, + 94, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 84, + 116, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo3", + "range": Array [ + 90, + 94, + ], + "type": "Identifier", + }, + ], + "name": "Foo3", + "references": Array [], + "scope": Object { + "$ref": 15, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/class-with-type-extends-default.ts 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 7, + 38, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "Bar": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 38, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Bar", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 35, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Bar": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 38, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Bar", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-interface.ts 1`] = ` +Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 110, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 11, + "block": Object { + "range": Array [ + 35, + 109, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 54, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 71, + 73, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 75, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 87, + 97, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 11, + 19, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 26, + 34, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + ], + "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, + "upperScope": null, + "variableMap": Object { + "s1": Object { + "$ref": 0, + }, + "s2": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + ], + "name": "s1", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 34, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + ], + "name": "s2", + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 109, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/computed-properties-in-type.ts 1`] = ` +Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 107, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 11, + "block": Object { + "range": Array [ + 35, + 106, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 51, + 53, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 68, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 72, + 82, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 84, + 94, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 11, + 19, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 26, + 34, + ], + "type": "CallExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + ], + "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 2, + }, + }, + "upperScope": null, + "variableMap": Object { + "s1": Object { + "$ref": 0, + }, + "s2": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "s1", + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + }, + ], + "name": "s1", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 34, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "s2", + "range": Array [ + 21, + 23, + ], + "type": "Identifier", + }, + ], + "name": "s2", + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 106, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function.ts 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 19, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 19, + 28, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "f", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "f", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "f", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "f", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-function-with-typeof.ts 1`] = ` +Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Key", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Value", + "range": Array [ + 45, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "subject", + "range": Array [ + 61, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "empty-function", + "typeMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "subject": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Key", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "subject", + "range": Array [ + 27, + 51, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "subject", + "range": Array [ + 27, + 51, + ], + "type": "Identifier", + }, + ], + "name": "subject", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "eachr": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "eachr", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "eachr", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + ], + "name": "eachr", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-global.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 55, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 42, + 43, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "C": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 25, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 34, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 21, + 34, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 25, + 34, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 2, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/declare-module.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 95, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 33, + 92, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 89, + 90, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "a": Object { + "$ref": 3, + }, + "b": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 52, + 61, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 52, + 61, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 46, + 61, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 52, + 61, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "b", + "range": Array [ + 79, + 90, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 79, + 90, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 73, + 90, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "b", + "range": Array [ + 79, + 90, + ], + "type": "Identifier", + }, + ], + "name": "b", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 11, + ], + "type": "Literal", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 93, + 94, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "a": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-array.ts 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 65, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 40, + 62, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-identifier.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 65, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 40, + 62, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "test": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 46, + 58, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 62, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 46, + 58, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 60, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 15, + 59, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 40, + 57, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 59, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 59, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 15, + 81, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 40, + 79, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "test": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 63, + 75, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 79, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 63, + 75, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 81, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 81, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 15, + 69, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 40, + 67, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Dec", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "test": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 49, + 53, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 67, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 49, + 53, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 69, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 69, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorators.ts 1`] = ` +Object { + "$id": 18, + "block": Object { + "range": Array [ + 0, + 198, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, + }, + "target": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "target", + "range": Array [ + 13, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "target", + "range": Array [ + 13, + 24, + ], + "type": "Identifier", + }, + ], + "name": "target", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 30, + 100, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "propertyKey": Object { + "$ref": 9, + }, + "target": Object { + "$ref": 8, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "target", + "range": Array [ + 59, + 70, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "target", + "range": Array [ + 59, + 70, + ], + "type": "Identifier", + }, + ], + "name": "target", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + Object { + "$id": 9, + "defs": Array [ + Object { + "name": Object { + "name": "propertyKey", + "range": Array [ + 72, + 91, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 98, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "propertyKey", + "range": Array [ + 72, + 91, + ], + "type": "Identifier", + }, + ], + "name": "propertyKey", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 7, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + Object { + "$id": 17, + "block": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 16, + "block": Object { + "range": Array [ + 159, + 195, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 15, + }, + }, + "variableScope": Object { + "$ref": 16, + }, + "variables": Array [ + Object { + "$id": 15, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 16, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 13, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "gec", + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "gec", + "range": Array [ + 147, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 18, + }, + "variableMap": Object { + "C": Object { + "$ref": 12, + }, + }, + "variableScope": Object { + "$ref": 18, + }, + "variables": Array [ + Object { + "$id": 12, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 17, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 18, + }, + "identifier": Object { + "name": "dec", + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "C": Object { + "$ref": 2, + }, + "dec": Object { + "$ref": 0, + }, + "gec": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 18, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "dec", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "dec", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + ], + "name": "dec", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 18, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "gec", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 30, + 100, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "gec", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + ], + "name": "gec", + "references": Array [ + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$ref": 18, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 102, + 197, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 18, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/empty-body-function.ts 1`] = ` +Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Map", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Key", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "Value", + "range": Array [ + 45, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "subject", + "range": Array [ + 61, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "empty-function", + "typeMap": Object { + "Key": Object { + "$ref": 1, + }, + "Value": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "subject": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Key", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "Key", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Value", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + ], + "name": "Value", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "subject", + "range": Array [ + 27, + 51, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "subject", + "range": Array [ + 27, + 51, + ], + "type": "Identifier", + }, + ], + "name": "subject", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "eachr": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "eachr", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 69, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "eachr", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + ], + "name": "eachr", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum.ts 1`] = ` +Object { + "$id": 14, + "block": Object { + "range": Array [ + 0, + 71, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 13, + "block": Object { + "range": Array [ + 20, + 70, + ], + "type": "TSEnumDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": Object { + "name": "a", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": Object { + "range": Array [ + 48, + 53, + ], + "type": "BinaryExpression", + }, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 48, + 49, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { + "range": Array [ + 63, + 68, + ], + "type": "BinaryExpression", + }, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 63, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], + "type": "enum", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "A": Object { + "$ref": 3, + }, + "B": Object { + "$ref": 4, + }, + "C": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 33, + 38, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 11, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 44, + 53, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 59, + 68, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 18, + 19, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "E": Object { + "$ref": 1, + }, + "a": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 19, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + ], + "scope": Object { + "$ref": 14, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "E", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 70, + ], + "type": "TSEnumDeclaration", + }, + "parent": undefined, + "type": "EnumName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "E", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "name": "E", + "references": Array [], + "scope": Object { + "$ref": 14, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum-string.ts 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSEnumDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "BAR", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "enum", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "BAR": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "BAR", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 26, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "BAR", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "BAR", + "references": Array [ + Object { + "$ref": 2, + }, + ], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSEnumDeclaration", + }, + "parent": undefined, + "type": "EnumName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 23, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-as.ts 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` +Object { + "$id": 16, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 6, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "d", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 60, + 61, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "f", + "range": Array [ + 63, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "Foo": Object { + "a": Object { "$ref": 0, }, + "b": Object { + "$ref": 1, + }, + "c": Object { + "$ref": 2, + }, + "d": Object { + "$ref": 3, + }, + "e": Object { + "$ref": 4, + }, + "f": Object { + "$ref": 5, + }, }, "variableScope": Object { - "$ref": 7, + "$ref": 16, }, "variables": Array [ Object { @@ -15795,1163 +23924,658 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 64, + 6, + 7, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 21, - 24, + 6, + 7, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-object.ts 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 15, - 59, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 40, - 57, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "name": "a", + "references": Array [ Object { - "$ref": 3, + "$ref": 8, }, ], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, + "scope": Object { + "$ref": 16, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 59, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "b", "range": Array [ - 21, - 24, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 59, + 9, + 10, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "b", "range": Array [ - 21, - 24, + 9, + 10, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "b", + "references": Array [ + Object { + "$ref": 9, + }, + ], "scope": Object { - "$ref": 6, + "$ref": 16, }, }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-parameter.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 6, - "block": Object { - "range": Array [ - 15, - 81, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ + "$id": 2, + "defs": Array [ Object { - "$id": 5, - "block": Object { + "name": Object { + "name": "c", "range": Array [ - 40, - 79, + 12, + 13, ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, + "node": Object { + "range": Array [ + 12, + 13, + ], + "type": "VariableDeclarator", }, - "variableScope": Object { - "$ref": 5, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 63, - 75, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 79, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 63, - 75, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "type": "Variable", }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "eslintUsed": true, + "identifiers": Array [ Object { - "$ref": 4, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", }, ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ + "name": "c", + "references": Array [ Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 81, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, + "$ref": 10, }, ], + "scope": Object { + "$ref": 16, + }, }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "d", "range": Array [ - 21, - 24, + 15, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ 15, - 81, + 16, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "d", "range": Array [ - 21, - 24, + 15, + 16, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "d", + "references": Array [ + Object { + "$ref": 13, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 16, }, }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorator-parameter-property-rest.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 70, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 6, - "block": Object { - "range": Array [ - 15, - 69, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ + "$id": 4, + "defs": Array [ Object { - "$id": 5, - "block": Object { + "name": Object { + "name": "e", "range": Array [ - 40, - 67, + 18, + 19, ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Dec", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "test": Object { - "$ref": 3, - }, + "node": Object { + "range": Array [ + 18, + 19, + ], + "type": "VariableDeclarator", }, - "variableScope": Object { - "$ref": 5, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 49, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 40, - 67, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 49, - 53, - ], - "type": "Identifier", - }, - ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "type": "Variable", }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "eslintUsed": true, + "identifiers": Array [ Object { - "$ref": 4, + "name": "e", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", }, ], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ + "name": "e", + "references": Array [ Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 15, - 69, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 6, - }, + "$ref": 14, }, ], + "scope": Object { + "$ref": 16, + }, }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 5, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "f", "range": Array [ 21, - 24, + 22, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 69, + 21, + 22, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "ClassName", + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "f", "range": Array [ 21, - 24, + 22, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "f", + "references": Array [ + Object { + "$ref": 15, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 16, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/decorators.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload.ts 1`] = ` Object { - "$id": 18, + "$id": 7, "block": Object { "range": Array [ 0, - 198, + 101, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 29, + 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 18, + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { + "range": Array [ + 19, + 46, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, }, "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "target": Object { - "$ref": 5, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "target", + "name": "a", "range": Array [ - 13, - 24, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 29, + 19, + 46, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "target", + "name": "a", "range": Array [ - 13, - 24, + 30, + 39, ], "type": "Identifier", }, ], - "name": "target", + "name": "a", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], }, Object { - "$id": 11, + "$id": 6, "block": Object { "range": Array [ - 30, + 47, 100, ], "type": "FunctionDeclaration", }, - "childScopes": Array [ - Object { - "$id": 10, - "block": Object { - "range": Array [ - 58, - 98, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": 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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 18, + "$ref": 7, }, "variableMap": Object { + "a": Object { + "$ref": 5, + }, "arguments": Object { - "$ref": 7, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 6, }, "variables": Array [ Object { - "$id": 7, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 6, }, }, - ], - }, - Object { - "$id": 17, - "block": Object { - "range": Array [ - 102, - 197, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ Object { - "$id": 16, - "block": Object { - "range": Array [ - 159, - 195, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 17, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 15, - }, - }, - "variableScope": Object { - "$ref": 16, - }, - "variables": Array [ + "$id": 5, + "defs": Array [ Object { - "$id": 15, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 16, + "name": Object { + "name": "a", + "range": Array [ + 58, + 68, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionDeclaration", }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 58, + 68, + ], + "type": "Identifier", }, ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 6, + }, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 13, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", + "name": Object { + "name": "f", "range": Array [ - 122, - 125, + 56, + 57, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 14, - "from": Object { - "$ref": 17, - }, - "identifier": Object { - "name": "gec", + "node": Object { "range": Array [ - 147, - 150, + 47, + 100, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, + "type": "FunctionDeclaration", }, - "writeExpr": undefined, + "parent": null, + "type": "FunctionName", }, ], - "throughReferences": Array [ - Object { - "$ref": 13, - }, + "eslintUsed": true, + "identifiers": Array [ Object { - "$ref": 14, + "name": "f", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", }, ], - "type": "class", + "name": "f", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 47, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 18, + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + Object { + "$id": 3, + "block": Object { + "range": Array [ + 19, + 46, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, }, "variableMap": Object { - "C": Object { - "$ref": 12, + "a": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 18, + "$ref": 4, }, "variables": Array [ Object { - "$id": 12, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "a", "range": Array [ - 113, - 114, + 30, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 19, + 46, ], - "type": "ClassDeclaration", + "type": "TSDeclareFunction", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "Parameter", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "C", + "name": "a", "range": Array [ - 113, - 114, + 30, + 39, ], "type": "Identifier", }, ], - "name": "C", + "name": "a", "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 3, }, }, ], @@ -16959,43 +24583,18 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 18, - }, - "identifier": Object { - "name": "dec", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "C": Object { - "$ref": 2, - }, - "dec": Object { + "f": Object { "$ref": 0, }, - "gec": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 18, + "$ref": 4, }, "variables": Array [ Object { @@ -17003,108 +24602,274 @@ Object { "defs": Array [ Object { "name": Object { - "name": "dec", + "name": "f", "range": Array [ 9, - 12, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 29, + 18, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "parent": null, "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "dec", + "name": "f", "range": Array [ 9, - 12, + 10, ], "type": "Identifier", }, ], - "name": "dec", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "name": "f", + "references": Array [], "scope": Object { - "$ref": 18, + "$ref": 4, }, }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 65, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 1, - "defs": Array [ + "$id": 6, + "block": Object { + "range": Array [ + 7, + 64, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "gec", + "$id": 5, + "block": Object { "range": Array [ - 39, - 42, + 35, + 62, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { - "range": Array [ - 30, - 100, - ], - "type": "FunctionDeclaration", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Decorator", + "range": Array [ + 37, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, }, - "parent": null, - "type": "FunctionName", + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "config": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "config", + "range": Array [ + 47, + 53, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 62, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "config", + "range": Array [ + 47, + 53, + ], + "type": "Identifier", + }, + ], + "name": "config", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "name": "gec", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", + "$ref": 4, }, ], - "name": "gec", - "references": Array [ - Object { - "$ref": 13, + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Test": Object { + "$ref": 1, }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ Object { - "$ref": 14, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 64, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 6, + }, }, ], - "scope": Object { - "$ref": 18, - }, }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "Test": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ Object { - "$id": 2, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Test", "range": Array [ - 113, - 114, + 13, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 102, - 197, + 7, + 64, ], "type": "ClassDeclaration", }, @@ -17112,46 +24877,71 @@ Object { "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "C", + "name": "Test", "range": Array [ - 113, - 114, + 13, + 17, ], "type": "Identifier", }, ], - "name": "C", + "name": "Test", "references": Array [], "scope": Object { - "$ref": 18, + "$ref": 7, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` Object { - "$id": 14, + "$id": 13, "block": Object { "range": Array [ 0, - 71, + 115, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 13, + "$id": 5, "block": Object { "range": Array [ - 20, - 70, + 0, + 15, ], - "type": "TSEnumDeclaration", + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], + }, + Object { + "$id": 7, + "block": Object { + "range": Array [ + 16, + 44, + ], + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, @@ -17160,574 +24950,667 @@ Object { Object { "$id": 6, "from": Object { - "$ref": 13, + "$ref": 7, }, "identifier": Object { "name": "A", "range": Array [ - 33, - 34, + 41, + 42, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 3, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], + }, + Object { + "$id": 12, + "block": Object { + "range": Array [ + 45, + 104, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 12, }, - "writeExpr": Object { - "name": "a", + "identifier": Object { + "name": "B", "range": Array [ - 37, - 38, + 65, + 66, ], "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 9, "from": Object { - "$ref": 13, + "$ref": 12, }, "identifier": Object { "name": "a", "range": Array [ - 37, - 38, + 80, + 91, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 3, }, "writeExpr": undefined, }, Object { - "$id": 8, + "$id": 10, "from": Object { - "$ref": 13, + "$ref": 12, }, "identifier": Object { - "name": "B", + "name": "A", "range": Array [ - 44, - 45, + 88, + 89, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 48, - 53, - ], - "type": "BinaryExpression", - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, Object { - "$id": 9, + "$id": 11, "from": Object { - "$ref": 13, + "$ref": 12, }, "identifier": Object { - "name": "a", + "name": "A", "range": Array [ - 48, - 49, + 99, + 100, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 113, + 114, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 4, + }, + ], + "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + "B": Object { + "$ref": 1, + }, + "C": Object { + "$ref": 2, + }, + }, + "upperScope": null, + "variableMap": Object { + "a": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 10, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "C", + "name": Object { + "name": "A", "range": Array [ - 59, - 60, + 5, + 6, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { + "node": Object { "range": Array [ - 63, - 68, + 0, + 15, ], - "type": "BinaryExpression", + "type": "TSTypeAliasDeclaration", }, + "parent": null, + "type": "TypeAliasName", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 11, - "from": Object { - "$ref": 13, - }, - "identifier": Object { - "name": "A", - "range": Array [ - 63, - 64, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": undefined, + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { - "$id": 12, - "from": Object { - "$ref": 13, - }, - "identifier": Object { + "name": Object { "name": "B", "range": Array [ - 67, - 68, + 26, + 27, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 4, + "node": Object { + "range": Array [ + 16, + 44, + ], + "type": "TSInterfaceDeclaration", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 7, - }, - Object { - "$ref": 9, + "parent": null, + "type": "InterfaceName", }, ], - "type": "enum", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "A": Object { - "$ref": 3, - }, - "B": Object { - "$ref": 4, - }, - "C": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 33, - 38, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 11, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 53, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "B", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - ], "name": "B", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 12, - }, - ], - "scope": Object { - "$ref": 13, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 59, - 68, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 10, - }, + "range": Array [ + 26, + 27, ], - "scope": Object { - "$ref": 13, - }, + "type": "Identifier", }, ], + "name": "B", + "references": Array [], + "scope": Object { + "$ref": 13, + }, }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ Object { "$id": 2, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 6, - 15, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 18, - 19, - ], - "type": "Literal", + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 45, + 104, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 13, }, }, - ], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "E": Object { - "$ref": 1, - }, - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 3, "defs": Array [ Object { "name": Object { "name": "a", "range": Array [ - 6, - 15, + 110, + 114, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 19, + 110, + 114, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 0, - 19, + 106, + 114, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "a", "range": Array [ - 6, - 15, + 110, + 114, ], "type": "Identifier", }, ], "name": "a", "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 7, - }, Object { "$ref": 9, }, ], "scope": Object { - "$ref": 14, + "$ref": 13, }, }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-equals.ts 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 1, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "E", + "name": "foo", "range": Array [ - 25, - 26, + 7, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 70, + 0, + 27, ], - "type": "TSEnumDeclaration", + "type": "TSImportEqualsDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "ImportBinding", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "E", + "name": "foo", "range": Array [ - 25, - 26, + 7, + 10, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` +Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/interface-type.ts 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 11, + 20, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], - "name": "E", - "references": Array [], - "scope": Object { - "$ref": 14, - }, }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/enum-string.ts 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ - 0, - 28, + 27, + 66, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 3, + "$ref": 7, }, "identifier": Object { - "name": "BAR", + "name": "C", "range": Array [ - 15, - 18, + 49, + 50, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 1, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, }, - "writeExpr": Object { + "identifier": Object { + "name": "C", "range": Array [ - 21, - 26, + 63, + 64, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "throughReferences": Array [], - "type": "enum", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "BAR": Object { - "$ref": 1, + "throughReferences": Array [ + Object { + "$ref": 5, }, + Object { + "$ref": 6, + }, + ], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 4, + }, + }, + "upperScope": Object { + "$ref": 8, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { - "$id": 1, + "$id": 4, "defs": Array [ Object { "name": Object { - "name": "BAR", + "name": "T", "range": Array [ - 15, - 18, + 39, + 40, ], "type": "Identifier", }, "node": Object { "range": Array [ - 15, - 26, + 38, + 51, ], - "type": "TSEnumMember", + "type": "TSTypeParameterDeclaration", }, - "parent": undefined, - "type": "EnumMemberName", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "BAR", + "name": "T", "range": Array [ - 15, - 18, + 39, + 40, ], "type": "Identifier", }, ], - "name": "BAR", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "T", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -17736,16 +25619,27 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { - "Foo": Object { + "typeMap": Object { + "C": Object { "$ref": 0, }, + "R": Object { + "$ref": 1, + }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -17753,334 +25647,205 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ - 5, - 8, + 10, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 28, + 25, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, - "parent": undefined, - "type": "EnumName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/export-as-namespace.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-as.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [], + "scope": Object { + "$ref": 8, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, }, - ], - "throughReferences": Array [ Object { - "$ref": 0, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 66, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "R", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + ], + "name": "R", + "references": Array [], + "scope": Object { + "$ref": 8, + }, }, ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/expression-type-parameters.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` Object { - "$id": 14, + "$id": 6, "block": Object { "range": Array [ 0, - 67, + 143, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "childScopes": Array [ Object { - "$id": 6, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "foo", + "$id": 5, + "block": Object { "range": Array [ 28, - 31, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "c", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 10, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 48, - 51, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 11, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "d", - "range": Array [ - 57, - 58, + 142, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 3, + "type": "FunctionDeclaration", }, - "writeExpr": undefined, - }, - Object { - "$id": 12, - "from": Object { - "$ref": 14, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "text", + "range": Array [ + 116, + 120, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, }, - "identifier": Object { - "name": "e", - "range": Array [ - 60, - 61, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 4, + "variableScope": Object { + "$ref": 5, }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "$id": 13, + "$id": 2, "from": Object { - "$ref": 14, + "$ref": 6, }, "identifier": Object { - "name": "f", + "name": "text", "range": Array [ - 63, - 64, + 6, + 10, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 5, + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 13, + 19, + ], + "type": "Literal", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 10, }, ], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "a": Object { - "$ref": 0, - }, - "b": Object { + "Foo": Object { "$ref": 1, }, - "c": Object { - "$ref": 2, - }, - "d": Object { - "$ref": 3, - }, - "e": Object { - "$ref": 4, - }, - "f": Object { - "$ref": 5, + "text": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 6, }, "variables": Array [ Object { @@ -18088,49 +25853,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "text", "range": Array [ 6, - 7, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 6, - 7, + 19, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, + 20, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "text", "range": Array [ 6, - 7, + 10, ], "type": "Identifier", }, ], - "name": "a", + "name": "text", "references": Array [ Object { - "$ref": 7, + "$ref": 2, + }, + Object { + "$ref": 4, }, ], "scope": Object { - "$ref": 14, + "$ref": 6, }, }, Object { @@ -18138,456 +25906,513 @@ Object { "defs": Array [ Object { "name": Object { - "name": "b", + "name": "Foo", "range": Array [ - 9, - 10, + 37, + 40, ], "type": "Identifier", }, "node": Object { "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, + 28, + 142, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "b", + "name": "Foo", "range": Array [ - 9, - 10, + 37, + 40, ], "type": "Identifier", }, ], - "name": "b", - "references": Array [ - Object { - "$ref": 8, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 6, }, }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/method-overload.ts 1`] = ` +Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 124, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 2, - "defs": Array [ + "$id": 10, + "block": Object { + "range": Array [ + 19, + 123, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "name": Object { - "name": "c", + "$id": 9, + "block": Object { "range": Array [ - 12, - 13, + 73, + 121, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "node": Object { - "range": Array [ - 12, - 13, - ], - "type": "VariableDeclarator", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 10, }, - "parent": Object { - "range": Array [ - 0, - 22, - ], - "type": "VariableDeclaration", + "variableMap": Object { + "a": Object { + "$ref": 8, + }, + "arguments": Object { + "$ref": 7, + }, }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "c", - "range": Array [ - 12, - 13, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 74, + 81, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 73, + 121, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 74, + 81, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, ], - "type": "Identifier", }, ], - "name": "c", + "functionExpressionScope": false, + "isStrict": true, "references": Array [ Object { - "$ref": 9, - }, - ], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "d", + "$id": 5, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "a", "range": Array [ - 15, - 16, + 49, + 60, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 15, - 16, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 10, }, - "parent": Object { + "identifier": Object { + "name": "s", "range": Array [ - 0, - 22, + 59, + 60, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "d", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", + "$ref": 5, + }, + Object { + "$ref": 6, }, ], - "name": "d", - "references": Array [ + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "A": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ Object { - "$ref": 11, + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 19, + 123, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 10, + }, }, ], - "scope": Object { - "$ref": 14, + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 18, + ], + "type": "CallExpression", }, }, Object { - "$id": 4, + "$id": 3, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "Symbol", + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + "s": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "e", + "name": "s", "range": Array [ - 18, - 19, + 6, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ + 6, 18, - 19, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, + 18, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "e", + "name": "s", "range": Array [ - 18, - 19, + 6, + 7, ], "type": "Identifier", }, ], - "name": "e", + "name": "s", "references": Array [ Object { - "$ref": 12, + "$ref": 2, + }, + Object { + "$ref": 6, }, ], "scope": Object { - "$ref": 14, + "$ref": 11, }, }, Object { - "$id": 5, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "f", + "name": "A", "range": Array [ - 21, - 22, + 25, + 26, ], "type": "Identifier", }, "node": Object { "range": Array [ - 21, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 0, - 22, + 19, + 123, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "f", + "name": "A", "range": Array [ - 21, - 22, + 25, + 26, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [ - Object { - "$ref": 13, - }, - ], + "name": "A", + "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 11, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/mixed-variable-ref.ts 1`] = ` Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 101, + 32, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { "$id": 1, - "block": Object { + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 0, - 18, + 6, + 9, ], - "type": "TSDeclareFunction", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, + "kind": "w", + "resolved": Object { + "$ref": 0, }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, + "writeExpr": Object { + "range": Array [ + 12, + 13, + ], + "type": "Literal", }, - "variables": Array [], }, Object { - "$id": 3, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 19, - 46, + 24, + 27, ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, - }, + "type": "Identifier", }, - "variableScope": Object { - "$ref": 7, + "kind": "r", + "resolved": Object { + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 46, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 30, - 39, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "writeExpr": undefined, }, Object { - "$id": 6, - "block": Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "test", "range": Array [ - 47, - 100, + 19, + 23, ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "a": Object { - "$ref": 5, - }, - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 6, + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 58, - 68, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 58, - 68, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "f": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -18595,145 +26420,193 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "foo", "range": Array [ - 56, - 57, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ - 47, - 100, + 6, + 13, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "FunctionName", + "parent": Object { + "range": Array [ + 0, + 14, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "f", + "name": "foo", "range": Array [ - 56, - 57, + 6, + 9, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/function-overload-2.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/namespace.ts 1`] = ` Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ 0, - 47, + 63, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, + "$id": 8, "block": Object { "range": Array [ - 19, - 46, + 24, + 56, ], - "type": "TSDeclareFunction", + "type": "TSModuleBlock", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], + "references": Array [ + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { + "range": Array [ + 47, + 48, + ], + "type": "Literal", + }, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], - "type": "empty-function", + "type": "block", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 9, }, "variableMap": Object { "a": Object { - "$ref": 2, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { - "$id": 2, + "$id": 5, "defs": Array [ Object { "name": Object { "name": "a", "range": Array [ - 30, - 39, + 43, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ - 19, - 46, + 43, + 48, ], - "type": "TSDeclareFunction", + "type": "VariableDeclarator", }, - "parent": null, - "type": "Parameter", + "parent": Object { + "range": Array [ + 37, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { "name": "a", "range": Array [ - 30, - 39, + 43, + 44, ], "type": "Identifier", }, ], "name": "a", - "references": Array [], + "references": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, ], @@ -18741,17 +26614,85 @@ Object { ], "functionExpressionScope": false, "isStrict": false, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 11, + ], + "type": "Literal", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "N", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "f": Object { + "N": Object { + "$ref": 1, + }, + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { @@ -18759,323 +26700,212 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "N", "range": Array [ - 9, - 10, + 22, + 23, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 18, + 12, + 56, ], - "type": "TSDeclareFunction", + "type": "TSModuleDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "NamespaceName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "f", + "name": "N", "range": Array [ - 9, - 10, + 22, + 23, ], "type": "Identifier", }, ], - "name": "f", - "references": Array [], + "name": "N", + "references": Array [ + Object { + "$ref": 4, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 9, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/identifier-decorators.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/rest-element.ts 1`] = ` Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 65, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ - 7, - 64, + 0, + 34, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 35, - 62, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 4, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "Decorator", - "range": Array [ - 37, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "config": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "config", - "range": Array [ - 47, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 35, - 62, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "config", - "range": Array [ - 47, - 53, - ], - "type": "Identifier", - }, - ], - "name": "config", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, - "isStrict": true, + "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "class", + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object { - "Test": Object { + "args": Object { + "$ref": 2, + }, + "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 3, }, "variables": Array [ Object { "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - ], - "name": "Test", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object { - "Test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 64, - ], - "type": "ClassDeclaration", + "$ref": 3, }, - "parent": null, - "type": "ClassName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Test", - "range": Array [ - 13, - 17, + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "args", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 34, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "args", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + ], + "name": "args", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], - "name": "Test", - "references": Array [], - "scope": Object { - "$ref": 7, - }, }, ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/ignore-type-only-stuff.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 115, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "a": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -19083,75 +26913,96 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "foo", "range": Array [ - 110, - 114, + 9, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ - 110, - 114, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 106, - 114, + 0, + 34, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "foo", "range": Array [ - 110, - 114, + 9, + 12, ], "type": "Identifier", }, ], - "name": "a", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-equals.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-alias.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 28, + 18, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -19161,20 +27012,20 @@ Object { "name": Object { "name": "foo", "range": Array [ - 7, - 10, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 27, + 17, ], - "type": "TSImportEqualsDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ImportBinding", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -19182,8 +27033,8 @@ Object { Object { "name": "foo", "range": Array [ - 7, - 10, + 5, + 8, ], "type": "Identifier", }, @@ -19191,134 +27042,249 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/import-keyword.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/interface-type.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 67, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/jsx-attributes.tsx 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` Object { - "$id": 6, + "$id": 12, "block": Object { "range": Array [ 0, - 143, + 103, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ - 28, - 142, + 0, + 15, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [ + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 32, + 102, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 5, + "$id": 10, + "block": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 11, }, - "identifier": Object { - "name": "text", - "range": Array [ - 116, - 120, - ], - "type": "Identifier", + "variableMap": Object { + "a": Object { + "$ref": 7, + }, + "arguments": Object { + "$ref": 6, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 10, }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 6, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + Object { + "$id": 7, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 48, + 59, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 47, + 100, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 48, + 59, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [ Object { - "$ref": 4, + "$ref": 8, + }, + Object { + "$ref": 9, }, ], - "type": "function", + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 12, }, "variableMap": Object { - "arguments": Object { - "$ref": 3, + "C": Object { + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 12, }, "variables": Array [ Object { - "$id": 3, - "defs": Array [], + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 32, + 102, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + ], + "name": "C", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 11, }, }, ], @@ -19328,44 +27294,51 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 3, "from": Object { - "$ref": 6, + "$ref": 12, }, "identifier": Object { - "name": "text", + "name": "A", "range": Array [ - 6, - 10, + 28, + 29, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 13, - 19, - ], - "type": "Literal", - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "C": Object { + "$ref": 2, }, - "text": Object { - "$ref": 0, + "a": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 12, }, "variables": Array [ Object { @@ -19373,325 +27346,278 @@ Object { "defs": Array [ Object { "name": Object { - "name": "text", + "name": "A", "range": Array [ + 5, 6, - 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 19, + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 20, + 31, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 31, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 0, - 20, + 16, + 31, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "text", + "name": "a", "range": Array [ - 6, - 10, + 20, + 31, ], "type": "Identifier", }, ], - "name": "text", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - ], + "name": "a", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 12, }, }, Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ - 37, - 40, + 38, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 28, - 142, + 32, + 102, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ - 37, - 40, + 38, + 39, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 12, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/method-overload.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ 0, - 124, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 7, "block": Object { "range": Array [ - 19, - 123, + 0, + 16, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "a": Object { - "$ref": 7, - }, - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 73, - 121, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 74, - 81, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "s", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], - "type": "class", + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "A": Object { - "$ref": 4, - }, + "$ref": 8, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 21, + 26, + ], + "type": "TSTypeAssertion", }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ Object { "$id": 2, "from": Object { - "$ref": 10, + "$ref": 8, }, "identifier": Object { - "name": "s", + "name": "A", "range": Array [ - 6, - 7, + 22, + 23, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", }, + "kind": "w", + "resolved": null, "writeExpr": Object { "range": Array [ - 10, - 18, + 32, + 38, ], - "type": "CallExpression", + "type": "TSAsExpression", }, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 10, + "$ref": 8, }, "identifier": Object { - "name": "Symbol", + "name": "b", "range": Array [ - 10, - 16, + 32, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 37, + 38, ], "type": "Identifier", }, @@ -19701,22 +27627,35 @@ Object { }, ], "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, Object { "$ref": 3, }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, ], "type": "global", - "upperScope": null, - "variableMap": Object { + "typeMap": Object { "A": Object { - "$ref": 1, - }, - "s": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 8, }, "variables": Array [ Object { @@ -19724,75 +27663,22 @@ Object { "defs": Array [ Object { "name": Object { - "name": "s", + "name": "A", "range": Array [ + 5, 6, - 7, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 18, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 18, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "s", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "s", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 10, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 19, - 123, + 16, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -19800,8 +27686,8 @@ Object { Object { "name": "A", "range": Array [ - 25, - 26, + 5, + 6, ], "type": "Identifier", }, @@ -19809,159 +27695,188 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 8, }, }, ], } `; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/namespace.ts 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 63, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 24, - 56, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 47, - 48, - ], - "type": "Literal", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 9, + "$ref": 4, }, "variableMap": Object { - "a": Object { - "$ref": 5, + "arguments": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 3, }, "variables": Array [ Object { - "$id": 5, + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "T", "range": Array [ - 43, - 44, + 11, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ - 43, - 48, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 37, - 48, + 10, + 13, ], - "type": "VariableDeclaration", + "type": "TSTypeParameterDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "T", "range": Array [ - 43, - 44, + 11, + 12, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], + "name": "T", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "f": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, ], + "name": "f", + "references": Array [], + "scope": Object { + "$ref": 4, + }, }, ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 2, + "$id": 1, "from": Object { - "$ref": 9, + "$ref": 3, }, "identifier": Object { "name": "a", @@ -19978,63 +27893,44 @@ Object { "writeExpr": Object { "range": Array [ 10, - 11, + 37, ], - "type": "Literal", + "type": "JSXElement", }, }, Object { - "$id": 3, + "$id": 2, "from": Object { - "$ref": 9, + "$ref": 3, }, "identifier": Object { - "name": "a", + "name": "TypeA", "range": Array [ - 57, - 58, + 28, + 33, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "N", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, + "$ref": 2, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "N": Object { - "$ref": 1, - }, "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 3, }, "variables": Array [ Object { @@ -20052,99 +27948,52 @@ Object { "node": Object { "range": Array [ 6, - 11, + 37, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 11, + 38, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "N", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 12, - 56, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "N", + "name": "a", "range": Array [ - 22, - 23, + 6, + 7, ], "type": "Identifier", }, ], - "name": "N", + "name": "a", "references": Array [ Object { - "$ref": 4, + "$ref": 1, }, ], "scope": Object { - "$ref": 9, + "$ref": 3, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/rest-element.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typed-this.src.ts 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 35, + 31, ], "type": "Program", }, @@ -20154,23 +28003,43 @@ Object { "block": Object { "range": Array [ 0, - 34, + 30, ], "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "String", + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "args": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, @@ -20190,57 +28059,22 @@ Object { "$ref": 3, }, }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "args", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 34, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "args", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - ], - "name": "args", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "foo": Object { + "test": Object { "$ref": 0, }, }, @@ -20253,17 +28087,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "test", "range": Array [ 9, - 12, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 34, + 30, ], "type": "FunctionDeclaration", }, @@ -20271,233 +28105,132 @@ Object { "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "foo", + "name": "test", "range": Array [ 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-alias.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 18, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-annotations.ts 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 103, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 4, - }, - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 47, - 100, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 48, - 59, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "C": Object { - "$ref": 2, + 13, + ], + "type": "Identifier", }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 4, }, - "variableScope": Object { - "$ref": 7, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof.ts 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 43, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 23, + 42, + ], + "type": "TSTypeAliasDeclaration", }, - "variables": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 102, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 6, + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, }, ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, - "references": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 22, + ], + "type": "ObjectExpression", + }, + }, + ], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { - "C": Object { + "typeMap": Object { + "B": Object { "$ref": 1, }, - "a": Object { + }, + "upperScope": null, + "variableMap": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [ Object { @@ -20505,45 +28238,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "obj", "range": Array [ - 20, - 31, + 4, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 20, - 31, + 4, + 22, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 16, - 31, + 0, + 22, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "obj", "range": Array [ - 20, - 31, + 4, + 7, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 5, }, }, Object { @@ -20551,52 +28291,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "C", + "name": "B", "range": Array [ - 38, - 39, + 28, + 29, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 102, + 23, + 42, ], - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "B", "range": Array [ - 38, - 39, + 28, + 29, ], "type": "Identifier", }, ], - "name": "C", + "name": "B", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 5, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-assertions.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, - 40, + 63, ], "type": "Program", }, @@ -20605,38 +28345,82 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 4, + "$ref": 8, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 22, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 8, }, "identifier": Object { "name": "a", "range": Array [ - 17, - 18, + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 27, + 40, + ], + "type": "TSTypeAssertion", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 35, + 38, ], "type": "Identifier", }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 21, - 26, - ], - "type": "TSTypeAssertion", + "kind": "r", + "resolved": Object { + "$ref": 0, }, + "writeExpr": undefined, }, Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 8, }, "identifier": Object { "name": "b", "range": Array [ - 25, - 26, + 39, + 40, ], "type": "Identifier", }, @@ -20645,15 +28429,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 4, + "$ref": 8, }, "identifier": Object { "name": "a", "range": Array [ - 28, - 29, + 42, + 43, ], "type": "Identifier", }, @@ -20661,22 +28445,22 @@ Object { "resolved": null, "writeExpr": Object { "range": Array [ - 32, - 38, + 46, + 61, ], "type": "TSAsExpression", }, }, Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 4, + "$ref": 8, }, "identifier": Object { "name": "b", "range": Array [ - 32, - 33, + 46, + 47, ], "type": "Identifier", }, @@ -20684,166 +28468,493 @@ Object { "resolved": null, "writeExpr": undefined, }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 58, + 61, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, }, Object { - "$ref": 1, + "$ref": 4, }, Object { - "$ref": 2, + "$ref": 5, }, Object { - "$ref": 3, + "$ref": 6, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "obj": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + ], + "name": "obj", + "references": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/type-parameter.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` Object { - "$id": 3, + "$id": 17, "block": Object { "range": Array [ 0, - 19, + 165, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 16, "block": Object { "range": Array [ - 0, - 18, + 25, + 164, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 66, + 79, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 76, + 79, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 81, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 84, + 85, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 95, + 98, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, + "$id": 10, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 125, + 128, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, }, + "writeExpr": undefined, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ Object { - "name": Object { - "name": "f", + "$id": 11, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "a", "range": Array [ - 9, - 10, + 130, + 143, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", "range": Array [ - 0, - 18, + 140, + 143, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "parent": null, - "type": "FunctionName", + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 145, + 149, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 148, + 149, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 16, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 159, + 162, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [ Object { - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 15, }, ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 3, + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, }, - }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typed-jsx-element.tsx 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 39, - ], - "type": "Program", - }, - "childScopes": Array [], + "upperScope": Object { + "$ref": 17, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 17, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 65, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "T", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 107, + 129, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$ref": 16, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 2, "from": Object { - "$ref": 2, + "$ref": 17, }, "identifier": Object { - "name": "a", + "name": "obj", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, @@ -20853,23 +28964,41 @@ Object { }, "writeExpr": Object { "range": Array [ - 10, - 37, + 12, + 24, ], - "type": "JSXElement", + "type": "ObjectExpression", }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 13, + }, + ], "type": "global", + "typeMap": Object { + "A": Object { + "$ref": 1, + }, + }, "upperScope": null, "variableMap": Object { - "a": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 17, }, "variables": Array [ Object { @@ -20877,124 +29006,247 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "obj", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 6, - 37, + 24, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 38, + 24, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "a", + "name": "obj", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "a", + "name": "obj", "references": Array [ Object { - "$ref": 1, + "$ref": 2, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 15, }, ], "scope": Object { - "$ref": 2, + "$ref": 17, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 164, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 17, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-return-type.ts 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 43, + 83, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { + "$id": 4, + "block": Object { "range": Array [ - 10, - 22, + 0, + 82, ], - "type": "ObjectExpression", + "type": "FunctionDeclaration", }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", + "variableMap": Object { + "a": Object { + "$ref": 2, + }, + "arguments": Object { + "$ref": 1, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 4, }, - "writeExpr": undefined, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 11, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 11, + 20, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "obj": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -21002,239 +29254,246 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "f", "range": Array [ - 4, - 7, + 9, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 82, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "obj", + "name": "f", "range": Array [ - 4, - 7, + 9, + 10, ], "type": "Identifier", }, ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "name": "f", + "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-assertions.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 63, + 62, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 27, - 40, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, + "childScopes": Array [ Object { - "$id": 5, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { + "$id": 6, + "block": Object { "range": Array [ - 46, + 0, 61, ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, + "type": "FunctionDeclaration", }, - "identifier": Object { - "name": "b", - "range": Array [ - 46, - 47, - ], - "type": "Identifier", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "g", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, + "upperScope": Object { + "$ref": 7, }, - "identifier": Object { - "name": "obj", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "g": Object { + "$ref": 3, + }, }, - "kind": "r", - "resolved": Object { - "$ref": 0, + "variableScope": Object { + "$ref": 6, }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 30, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "g", + "range": Array [ + 31, + 35, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 61, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "g", + "range": Array [ + 31, + 35, + ], + "type": "Identifier", + }, + ], + "name": "g", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "obj": Object { + "g": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [ Object { @@ -21242,68 +29501,52 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "g", "range": Array [ - 4, - 7, + 9, + 10, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 22, + 61, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "obj", + "name": "g", "range": Array [ - 4, - 7, + 9, + 10, ], "type": "Identifier", }, ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 7, - }, - ], + "name": "g", + "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 7, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-call-signature.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` Object { - "$id": 8, + "$id": 11, "block": Object { "range": Array [ 0, - 165, + 147, ], "type": "Program", }, @@ -21312,15 +29555,15 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { "name": "obj", "range": Array [ - 6, - 9, + 4, + 7, ], "type": "Identifier", }, @@ -21330,41 +29573,47 @@ Object { }, "writeExpr": Object { "range": Array [ - 12, - 24, + 10, + 22, ], "type": "ObjectExpression", }, }, Object { - "$id": 2, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { - "name": "obj", + "name": "obj2", "range": Array [ - 61, - 64, + 27, + 43, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 0, + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 46, + 58, + ], + "type": "ObjectExpression", }, - "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 6, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { "name": "obj", "range": Array [ - 76, - 79, + 40, + 43, ], "type": "Identifier", }, @@ -21375,34 +29624,40 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 7, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { - "name": "obj", + "name": "value", "range": Array [ - 95, - 98, + 65, + 70, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 0, + "$ref": 2, + }, + "writeExpr": Object { + "range": Array [ + 87, + 99, + ], + "type": "ObjectExpression", }, - "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 8, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { "name": "obj", "range": Array [ - 125, - 128, + 81, + 84, ], "type": "Identifier", }, @@ -21413,34 +29668,40 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 9, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { - "name": "obj", + "name": "element", "range": Array [ - 140, - 143, + 105, + 112, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 0, + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 132, + 146, + ], + "type": "ArrayExpression", }, - "writeExpr": undefined, }, Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 8, + "$ref": 11, }, "identifier": Object { "name": "obj", "range": Array [ - 159, - 162, + 123, + 126, ], "type": "Identifier", }, @@ -21453,14 +29714,24 @@ Object { ], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { + "element": Object { + "$ref": 3, + }, "obj": Object { "$ref": 0, }, + "obj2": Object { + "$ref": 1, + }, + "value": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 8, + "$ref": 11, }, "variables": Array [ Object { @@ -21470,35 +29741,35 @@ Object { "name": Object { "name": "obj", "range": Array [ - 6, - 9, + 4, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 24, + 4, + 22, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 24, + 22, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", "range": Array [ - 6, - 9, + 4, + 7, ], "type": "Identifier", }, @@ -21506,152 +29777,211 @@ Object { "name": "obj", "references": Array [ Object { - "$ref": 1, + "$ref": 4, }, Object { - "$ref": 2, + "$ref": 6, }, Object { - "$ref": 3, + "$ref": 8, }, Object { - "$ref": 4, + "$ref": 10, }, + ], + "scope": Object { + "$ref": 11, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { - "$ref": 5, + "name": Object { + "name": "obj2", + "range": Array [ + 27, + 43, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 58, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 23, + 58, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, + ], + "eslintUsed": true, + "identifiers": Array [ Object { - "$ref": 6, + "name": "obj2", + "range": Array [ + 27, + 43, + ], + "type": "Identifier", }, + ], + "name": "obj2", + "references": Array [ Object { - "$ref": 7, + "$ref": 5, }, ], "scope": Object { - "$ref": 8, + "$ref": 11, }, }, - ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-return-type.ts 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 83, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "$id": 2, + "defs": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "a", + "name": Object { + "name": "value", "range": Array [ - 30, - 31, + 65, + 70, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "node": Object { + "range": Array [ + 63, + 99, + ], + "type": "VariableDeclarator", }, - "writeExpr": undefined, + "parent": Object { + "range": Array [ + 59, + 99, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 2, + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "value", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", }, - "arguments": Object { - "$ref": 1, + ], + "name": "value", + "references": Array [ + Object { + "$ref": 7, }, + ], + "scope": Object { + "$ref": 11, }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ + }, + Object { + "$id": 3, + "defs": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, + "name": Object { + "name": "element", + "range": Array [ + 105, + 112, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 104, + 146, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 100, + 146, + ], + "type": "VariableDeclaration", }, + "type": "Variable", }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 11, - 20, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 3, - }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "element", + "range": Array [ + 105, + 112, ], - "scope": Object { - "$ref": 4, - }, + "type": "Identifier", + }, + ], + "name": "element", + "references": Array [ + Object { + "$ref": 9, }, ], + "scope": Object { + "$ref": 11, + }, + }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -21659,14 +29989,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", - "upperScope": null, - "variableMap": Object { - "f": Object { + "typeMap": Object { + "Foo": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -21674,177 +30005,147 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f", + "name": "Foo", "range": Array [ - 9, - 10, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 19, ], - "type": "FunctionDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f", + "name": "Foo", "range": Array [ - 9, - 10, + 5, + 8, ], "type": "Identifier", }, ], - "name": "f", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-type-parameters.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` Object { - "$id": 5, + "$id": 1, "block": Object { "range": Array [ 0, - 62, + 49, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "g", + "name": Object { + "name": "x", "range": Array [ - 28, - 29, + 4, + 47, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "node": Object { + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "g": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, + "parent": Object { + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", }, + "type": "Variable", }, + ], + "eslintUsed": true, + "identifiers": Array [ Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "g", - "range": Array [ - 31, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 61, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "g", - "range": Array [ - 31, - 35, - ], - "type": "Identifier", - }, - ], - "name": "g", - "references": Array [ - Object { - "$ref": 3, - }, + "name": "x", + "range": Array [ + 4, + 47, ], - "scope": Object { - "$ref": 4, - }, + "type": "Identifier", }, ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, }, ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 47, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "g": Object { + "x": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 1, }, "variables": Array [ Object { @@ -21852,52 +30153,58 @@ Object { "defs": Array [ Object { "name": Object { - "name": "g", + "name": "x", "range": Array [ - 9, - 10, + 4, + 45, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 61, + 46, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "g", + "name": "x", "range": Array [ - 9, - 10, + 4, + 45, ], "type": "Identifier", }, ], - "name": "g", + "name": "x", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 1, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/typeof-in-var.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` Object { - "$id": 11, + "$id": 3, "block": Object { "range": Array [ 0, - 147, + 13, ], "type": "Program", }, @@ -21906,182 +30213,58 @@ Object { "isStrict": false, "references": Array [ Object { - "$id": 4, + "$id": 1, "from": Object { - "$ref": 11, + "$ref": 3, }, "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { + "name": "K", "range": Array [ + 9, 10, - 22, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 46, - 58, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 40, - 43, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, Object { - "$id": 7, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 87, - 99, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 8, + "$id": 2, "from": Object { - "$ref": 11, + "$ref": 3, }, "identifier": Object { - "name": "obj", + "name": "T", "range": Array [ - 81, - 84, + 7, + 8, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 9, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 132, - 146, - ], - "type": "ArrayExpression", - }, + "$ref": 1, }, Object { - "$id": 10, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 123, - 126, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, + "$ref": 2, }, ], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { - "element": Object { - "$ref": 3, - }, - "obj": Object { + "x": Object { "$ref": 0, }, - "obj2": Object { - "$ref": 1, - }, - "value": Object { - "$ref": 2, - }, }, "variableScope": Object { - "$ref": 11, + "$ref": 3, }, "variables": Array [ Object { @@ -22089,263 +30272,400 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "x", "range": Array [ 4, - 7, + 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 22, + 11, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 22, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - ], - "name": "obj", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 10, - }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "obj2", - "range": Array [ - 27, - 43, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 58, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 23, - 58, + 12, ], "type": "VariableDeclaration", }, "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { - "name": "obj2", + "name": "x", "range": Array [ - 27, - 43, + 4, + 11, ], "type": "Identifier", }, ], - "name": "obj2", - "references": Array [ - Object { - "$ref": 5, - }, - ], + "name": "x", + "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 3, }, }, + ], +} +`; + +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-infer.ts 1`] = ` +Object { + "$id": 14, + "block": Object { + "range": Array [ + 0, + 147, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 2, - "defs": Array [ + "$id": 13, + "block": Object { + "range": Array [ + 0, + 146, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "name": Object { - "name": "value", + "$id": 2, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ - 65, - 70, + 23, + 24, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 63, - 99, + 40, + 41, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", "range": Array [ 59, - 99, + 60, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "value", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 75, + 76, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "name": "value", - "references": Array [ Object { - "$ref": 7, + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 79, + 80, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "scope": Object { - "$ref": 11, - }, - }, - Object { - "$id": 3, - "defs": Array [ Object { - "name": Object { - "name": "element", + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 95, + 96, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "Promise", "range": Array [ 105, 112, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 104, - 146, + 119, + 120, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", "range": Array [ - 100, - 146, + 124, + 125, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 144, + 145, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "element", - "range": Array [ - 105, - 112, - ], - "type": "Identifier", + "$ref": 11, }, ], - "name": "element", - "references": Array [ + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ Object { - "$ref": 9, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, }, ], - "scope": Object { - "$ref": 11, - }, }, ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-array-type.src.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-conditional.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "Unpacked": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 14, }, "variables": Array [ Object { @@ -22353,151 +30673,212 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "Unpacked", "range": Array [ - 4, - 47, + 5, + 13, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 48, + 146, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "Unpacked", "range": Array [ - 4, - 47, + 5, + 13, ], "type": "Identifier", }, ], - "name": "x", + "name": "Unpacked", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 14, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-conditional-with-null.src.ts 1`] = ` +exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, - 47, + 50, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 5, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [ Object { - "name": Object { - "name": "x", + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", "range": Array [ - 4, - 45, + 21, + 22, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "LinkedList", "range": Array [ - 4, - 45, + 33, + 43, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", "range": Array [ - 0, - 46, + 44, + 45, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ Object { - "name": "x", - "range": Array [ - 4, - 45, + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, + }, }, ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 1, - }, }, ], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-indexed.src.ts 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 13, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", - "upperScope": null, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "LinkedList": Object { "$ref": 0, }, }, + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [ Object { @@ -22505,104 +30886,48 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "LinkedList", "range": Array [ - 4, - 11, + 5, + 15, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 12, + 49, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "LinkedList", "range": Array [ - 4, - 11, + 5, + 15, ], "type": "Identifier", }, ], - "name": "x", + "name": "LinkedList", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 6, }, }, ], } `; -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-infer.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - -exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-intersection-type.src.ts 1`] = ` -Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], -} -`; - exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22613,9 +30938,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -22623,7 +30971,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22655,7 +31003,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -22669,7 +31017,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22678,7 +31026,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22689,9 +31037,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -22699,7 +31070,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22731,7 +31102,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -22745,7 +31116,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22754,7 +31125,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly-minus.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22765,9 +31136,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -22775,7 +31169,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22807,7 +31201,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -22821,7 +31215,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22830,7 +31224,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-mapped-readonly-plus.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22841,9 +31235,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "map": Object { @@ -22851,7 +31268,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22883,7 +31300,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "map", @@ -22897,7 +31314,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22906,7 +31323,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-nested-types.src.ts 1`] = ` Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22914,24 +31331,96 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-parenthesized-type.src.ts 1`] = ` Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22939,24 +31428,96 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22967,9 +31528,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -22977,7 +31561,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -23009,7 +31593,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23023,7 +31607,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -23032,7 +31616,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference-generic.src.ts 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -23043,9 +31627,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23053,7 +31660,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -23085,7 +31692,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23099,7 +31706,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -23108,7 +31715,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-reference-generic-nested.src.ts 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -23119,9 +31726,52 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 13, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23129,7 +31779,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -23161,7 +31811,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23175,7 +31825,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -23198,6 +31848,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23237,7 +31888,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23274,6 +31925,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23313,7 +31965,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23350,6 +32002,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23389,7 +32042,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23426,6 +32079,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23465,7 +32119,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23488,7 +32142,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-tuple-type.src.ts 1`] = ` Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -23496,18 +32150,90 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; @@ -23527,6 +32253,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "obj": Object { @@ -23566,7 +32293,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "obj", @@ -23589,7 +32316,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-type-operator.src.ts 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -23600,9 +32327,32 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23613,7 +32363,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -23645,7 +32395,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23659,7 +32409,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, Object { @@ -23691,7 +32441,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "y", @@ -23705,7 +32455,7 @@ Object { "name": "y", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -23750,6 +32500,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "x": Object { @@ -23789,7 +32540,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "x", @@ -23826,6 +32577,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object { "intersection": Object { @@ -23874,7 +32626,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "union", @@ -23920,7 +32672,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "intersection", @@ -23966,7 +32718,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "precedence1", @@ -24012,7 +32764,7 @@ Object { "type": "Variable", }, ], - "eslintUsed": undefined, + "eslintUsed": true, "identifiers": Array [ Object { "name": "precedence2", @@ -24035,7 +32787,7 @@ Object { exports[`TypeScript scope analysis sourceType: script tests/fixtures/scope-analysis/types-union-type.src.ts 1`] = ` Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -24043,17 +32795,89 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], } `; diff --git a/packages/parser/tests/lib/__snapshots__/tsx.ts.snap b/packages/parser/tests/lib/__snapshots__/tsx.ts.snap index 59b060335a70..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 { @@ -52,7 +54,7 @@ Object { exports[`TSX fixtures/react-typed-props.src 1`] = ` Object { - "$id": 7, + "$id": 10, "block": Object { "range": Array [ 0, @@ -62,7 +64,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -72,7 +74,32 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, + "block": Object { + "range": Array [ + 31, + 63, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [], + }, + Object { + "$id": 8, "block": Object { "range": Array [ 80, @@ -85,9 +112,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 +145,46 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 5, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "arguments": Object { - "$ref": 2, + "$ref": 4, }, "props": Object { - "$ref": 3, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { - "$id": 2, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, Object { - "$id": 3, + "$id": 5, "defs": Array [ Object { "name": Object { @@ -169,11 +220,11 @@ Object { "name": "props", "references": Array [ Object { - "$ref": 4, + "$ref": 7, }, ], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -184,19 +235,24 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Props": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 10, }, "variableMap": Object { "App": Object { - "$ref": 1, + "$ref": 2, }, "React": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [ Object { @@ -242,11 +298,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 +382,7 @@ Object { "name": "App", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 9, }, }, ], @@ -293,10 +393,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 10, }, "variables": Array [], } diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index eeff596aead1..4f353b94fb7f 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -2,7 +2,7 @@ exports[`typescript fixtures/babylon-convergence/type-parameter-whitespace-loc.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -12,7 +12,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -22,7 +22,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36,8 +36,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "arguments": Object { @@ -45,7 +50,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -56,7 +61,47 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -67,8 +112,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -76,7 +122,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -116,7 +162,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -127,10 +173,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -138,7 +185,7 @@ Object { exports[`typescript fixtures/babylon-convergence/type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -148,7 +195,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -158,7 +205,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -172,8 +219,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "arguments": Object { @@ -181,7 +233,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -192,7 +244,47 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 37, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -203,8 +295,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "f": Object { @@ -212,7 +305,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -252,7 +345,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -263,10 +356,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -308,6 +402,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -368,6 +463,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -428,6 +524,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -439,7 +536,7 @@ Object { exports[`typescript fixtures/basics/abstract-class-with-abstract-method.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -449,7 +546,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -459,7 +556,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -470,11 +567,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Promise", + "range": Array [ + 68, + 75, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "AbstractSocket": Object { @@ -482,7 +602,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -522,7 +642,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -531,10 +651,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "AbstractSocket": Object { @@ -542,7 +667,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -582,7 +707,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -591,12 +716,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -638,6 +768,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -698,6 +829,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -758,6 +890,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -803,6 +936,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -863,6 +997,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -923,6 +1058,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -934,7 +1070,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 +1080,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -954,7 +1090,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -965,11 +1101,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Promise", + "range": Array [ + 60, + 67, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "AbstractSocket": Object { @@ -977,7 +1136,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -1017,7 +1176,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -1026,10 +1185,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "AbstractSocket": Object { @@ -1037,7 +1201,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -1077,7 +1241,7 @@ Object { "name": "AbstractSocket", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -1086,12 +1250,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -1099,7 +1268,7 @@ Object { exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -1109,7 +1278,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -1117,20 +1286,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 7, + 31, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "I": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "I", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 31, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "I", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + ], + "name": "I", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -1138,10 +1379,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -1203,6 +1445,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1267,6 +1510,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1282,6 +1526,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1293,7 +1538,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 +1548,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, @@ -1313,7 +1558,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1326,9 +1571,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,27 +1623,79 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 0, + "$ref": 1, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 6, }, "variableMap": Object { "b": Object { - "$ref": 0, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [ Object { "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 3, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + Object { + "$id": 1, "defs": Array [ Object { "name": Object { @@ -1396,11 +1731,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 1, + "$ref": 4, }, ], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -1411,12 +1746,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [], }, @@ -1426,10 +1762,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } @@ -1481,6 +1818,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -1512,6 +1850,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function-expression-name", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -1572,6 +1911,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -1587,6 +1927,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1708,6 +2049,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -1898,6 +2240,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -1958,6 +2301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -1969,7 +2313,7 @@ Object { exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -1979,7 +2323,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -1987,31 +2331,160 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 61, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 16, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 41, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 61, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -2019,7 +2492,7 @@ Object { exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, @@ -2029,7 +2502,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 5, "block": Object { "range": Array [ 0, @@ -2037,31 +2510,232 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 19, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 47, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + Object { + "name": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 46, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 6, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 5, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 67, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } @@ -2135,6 +2809,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -2157,6 +2832,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2168,7 +2844,7 @@ Object { exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -2178,7 +2854,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -2193,7 +2869,7 @@ Object { Object { "$id": 0, "from": Object { - "$ref": 1, + "$ref": 2, }, "identifier": Object { "name": "x", @@ -2207,19 +2883,40 @@ Object { "resolved": null, "writeExpr": undefined, }, + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, ], "throughReferences": Array [ Object { "$ref": 0, }, + Object { + "$ref": 1, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -2231,12 +2928,16 @@ Object { Object { "$ref": 0, }, + Object { + "$ref": 1, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -2290,6 +2991,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -2309,6 +3011,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2366,6 +3069,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -2385,6 +3089,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2467,6 +3172,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2541,6 +3247,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2586,6 +3293,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2668,6 +3376,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -2732,6 +3441,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2777,6 +3487,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -2859,6 +3570,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -2923,6 +3635,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -2978,6 +3691,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3038,6 +3752,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3116,6 +3831,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -3176,6 +3892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -3236,6 +3953,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3291,6 +4009,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3331,6 +4050,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3362,6 +4082,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3422,6 +4143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3482,6 +4204,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3537,6 +4260,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3577,6 +4301,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -3608,6 +4333,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -3668,6 +4394,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -3728,6 +4455,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -3739,7 +4467,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 +4477,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -3759,7 +4487,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -3769,7 +4497,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 23, @@ -3783,8 +4511,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "arguments": Object { @@ -3792,7 +4525,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -3803,13 +4536,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, @@ -3823,27 +4596,72 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "arguments": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 51, + 54, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, }, }, ], @@ -3854,8 +4672,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "C": Object { @@ -3863,7 +4682,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -3903,7 +4722,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -3914,8 +4733,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -3923,7 +4743,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -3963,7 +4783,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -3974,10 +4794,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -4019,6 +4840,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -4079,6 +4901,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -4139,6 +4962,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4194,6 +5018,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -4268,6 +5093,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -4328,6 +5154,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -4388,6 +5215,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -4399,7 +5227,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 +5237,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -4419,7 +5247,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -4430,11 +5258,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "MyInterface", + "range": Array [ + 66, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -4442,7 +5293,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -4482,7 +5333,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -4494,7 +5345,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "MyOtherClass", @@ -4513,10 +5364,14 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 3, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -4524,7 +5379,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -4564,7 +5419,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -4577,12 +5432,16 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 3, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -4590,7 +5449,7 @@ Object { exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -4600,7 +5459,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -4610,7 +5469,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -4621,11 +5480,38 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -4633,7 +5519,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { @@ -4673,7 +5559,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 5, }, }, ], @@ -4685,7 +5611,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { "name": "Bar", @@ -4704,10 +5630,14 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 4, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -4715,7 +5645,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { @@ -4755,7 +5685,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -4768,12 +5698,16 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 4, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [], } @@ -4781,7 +5715,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 +5725,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, @@ -4801,7 +5735,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, @@ -4812,11 +5746,78 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "D", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + ], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -4824,7 +5825,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -4864,7 +5865,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 7, }, }, ], @@ -4876,7 +5917,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 8, }, "identifier": Object { "name": "Bar", @@ -4895,10 +5936,20 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object { "Foo": Object { @@ -4906,7 +5957,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -4946,7 +5997,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -4959,12 +6010,22 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 9, }, "variables": Array [], } @@ -4972,7 +6033,7 @@ Object { exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -4982,7 +6043,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -4992,7 +6053,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5002,7 +6063,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 20, @@ -5016,8 +6077,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "arguments": Object { @@ -5025,7 +6091,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -5036,7 +6102,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, }, }, ], @@ -5047,8 +6153,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -5056,7 +6163,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -5096,7 +6203,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -5107,8 +6214,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -5116,7 +6224,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -5156,7 +6264,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -5167,10 +6275,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -5178,7 +6287,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 +6297,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, @@ -5198,7 +6307,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5208,7 +6317,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 20, @@ -5219,11 +6328,38 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "arguments": Object { @@ -5231,7 +6367,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -5242,7 +6378,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 +6427,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -5262,7 +6443,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -5302,7 +6483,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -5311,10 +6492,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "Foo": Object { @@ -5322,7 +6508,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -5362,7 +6548,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -5371,12 +6557,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } @@ -5384,7 +6575,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5394,7 +6585,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5404,7 +6595,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -5415,11 +6606,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -5427,7 +6641,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -5467,7 +6681,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -5476,10 +6690,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -5487,7 +6706,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -5527,7 +6746,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -5536,12 +6755,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -5549,7 +6773,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 +6783,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5569,7 +6793,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5580,11 +6804,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "MyInterface", + "range": Array [ + 45, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -5592,7 +6839,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -5632,7 +6879,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -5644,7 +6891,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 4, + "$ref": 5, }, "identifier": Object { "name": "MyOtherClass", @@ -5663,10 +6910,14 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 3, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "ClassWithParentAndInterface": Object { @@ -5674,7 +6925,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -5714,7 +6965,7 @@ Object { "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -5727,12 +6978,16 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 3, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -5740,7 +6995,7 @@ Object { exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5750,7 +7005,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5760,7 +7015,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -5771,11 +7026,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -5783,7 +7081,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -5823,7 +7121,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -5832,10 +7130,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -5843,7 +7149,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -5883,7 +7189,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -5892,12 +7198,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -5905,7 +7219,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 +7229,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, @@ -5925,7 +7239,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -5936,11 +7250,74 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -5948,7 +7325,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -5988,7 +7365,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -5997,10 +7374,21 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6008,7 +7396,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -6048,7 +7436,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -6057,12 +7445,23 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } @@ -6070,7 +7469,7 @@ Object { exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -6080,7 +7479,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -6090,7 +7489,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -6114,8 +7513,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -6140,7 +7540,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 35, @@ -6154,8 +7554,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 5, + }, + }, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -6163,7 +7568,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -6174,13 +7579,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, @@ -6194,27 +7639,28 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { - "$ref": 6, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { - "$id": 6, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -6225,8 +7671,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "C": Object { @@ -6234,7 +7681,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -6274,7 +7721,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -6285,8 +7732,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "C": Object { @@ -6294,7 +7742,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -6334,7 +7782,7 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -6345,10 +7793,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -6356,7 +7805,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 15, + "$id": 26, "block": Object { "range": Array [ 0, @@ -6366,7 +7815,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 14, + "$id": 25, "block": Object { "range": Array [ 0, @@ -6376,7 +7825,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 14, "block": Object { "range": Array [ 0, @@ -6386,7 +7835,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 13, "block": Object { "range": Array [ 60, @@ -6400,12 +7849,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 14, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 14, }, "variables": Array [], }, @@ -6414,9 +7864,47 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 7, + "$id": 10, "from": Object { - "$ref": 9, + "$ref": 14, + }, + "identifier": Object { + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 8, + }, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 14, }, "identifier": Object { "name": "Base", @@ -6428,41 +7916,94 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 6, + "$ref": 9, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 10, + }, + ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 8, + }, + }, "upperScope": Object { - "$ref": 14, + "$ref": 25, }, "variableMap": Object { "Base": Object { - "$ref": 6, + "$ref": 9, }, "arguments": Object { - "$ref": 5, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 14, }, "variables": Array [ Object { - "$id": 5, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 14, }, }, Object { - "$id": 6, + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 37, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 11, + }, + ], + "scope": Object { + "$ref": 14, + }, + }, + Object { + "$id": 9, "defs": Array [ Object { "name": Object { @@ -6498,17 +8039,17 @@ Object { "name": "Base", "references": Array [ Object { - "$ref": 7, + "$ref": 12, }, ], "scope": Object { - "$ref": 9, + "$ref": 14, }, }, ], }, Object { - "$id": 11, + "$id": 17, "block": Object { "range": Array [ 86, @@ -6519,23 +8060,48 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 16, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "I", + "range": Array [ + 123, + 124, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 16, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 14, + "$ref": 25, }, "variableMap": Object { "X": Object { - "$ref": 10, + "$ref": 15, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { - "$id": 10, + "$id": 15, "defs": Array [ Object { "name": Object { @@ -6571,13 +8137,13 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 17, }, }, ], }, Object { - "$id": 13, + "$id": 19, "block": Object { "range": Array [ 130, @@ -6591,20 +8157,21 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 14, + "$ref": 25, }, "variableMap": Object { "C": Object { - "$ref": 12, + "$ref": 18, }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { - "$id": 12, + "$id": 18, "defs": Array [ Object { "name": Object { @@ -6640,7 +8207,147 @@ Object { "name": "C", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 19, + }, + }, + ], + }, + Object { + "$id": 20, + "block": Object { + "range": Array [ + 142, + 157, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 25, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 25, + }, + "variables": Array [], + }, + Object { + "$id": 24, + "block": Object { + "range": Array [ + 158, + 206, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 22, + "from": Object { + "$ref": 24, + }, + "identifier": Object { + "name": "args", + "range": Array [ + 188, + 192, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 23, + "from": Object { + "$ref": 24, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 21, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 22, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 21, + }, + }, + "upperScope": Object { + "$ref": 25, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 25, + }, + "variables": Array [ + Object { + "$id": 21, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 175, + 176, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 174, + 177, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 175, + 176, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 23, + }, + ], + "scope": Object { + "$ref": 24, }, }, ], @@ -6650,9 +8357,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 14, + "$ref": 25, }, "identifier": Object { "name": "M", @@ -6669,9 +8376,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 6, "from": Object { - "$ref": 14, + "$ref": 25, }, "identifier": Object { "name": "C", @@ -6688,10 +8395,22 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 22, + }, + ], "type": "module", + "typeMap": Object { + "Constructor": Object { + "$ref": 4, + }, + "I": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 15, + "$ref": 26, }, "variableMap": Object { "C": Object { @@ -6705,7 +8424,7 @@ Object { }, }, "variableScope": Object { - "$ref": 14, + "$ref": 25, }, "variables": Array [ Object { @@ -6745,11 +8464,11 @@ Object { "name": "M", "references": Array [ Object { - "$ref": 3, + "$ref": 5, }, ], "scope": Object { - "$ref": 14, + "$ref": 25, }, }, Object { @@ -6789,7 +8508,7 @@ Object { "name": "X", "references": Array [], "scope": Object { - "$ref": 14, + "$ref": 25, }, }, Object { @@ -6829,11 +8548,99 @@ Object { "name": "C", "references": Array [ Object { - "$ref": 4, + "$ref": 6, }, ], "scope": Object { - "$ref": 14, + "$ref": 25, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "I", + "range": Array [ + 152, + 153, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 142, + 157, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "I", + "range": Array [ + 152, + 153, + ], + "type": "Identifier", + }, + ], + "name": "I", + "references": Array [ + Object { + "$ref": 16, + }, + ], + "scope": Object { + "$ref": 25, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "Constructor", + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 158, + 206, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Constructor", + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + }, + ], + "name": "Constructor", + "references": Array [ + Object { + "$ref": 10, + }, + ], + "scope": Object { + "$ref": 25, }, }, ], @@ -6842,12 +8649,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 22, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 26, }, "variables": Array [], } @@ -6855,7 +8667,7 @@ Object { exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, @@ -6865,7 +8677,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 8, "block": Object { "range": Array [ 0, @@ -6875,7 +8687,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 7, "block": Object { "range": Array [ 0, @@ -6886,22 +8698,88 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "M", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 8, }, "variableMap": Object { "Base": Object { - "$ref": 2, + "$ref": 3, }, "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 7, }, "variables": Array [ Object { @@ -6912,11 +8790,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 +8874,7 @@ Object { "name": "Base", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 7, }, }, ], @@ -6961,10 +8883,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object { "M": Object { @@ -6972,7 +8902,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ Object { @@ -7012,7 +8942,7 @@ Object { "name": "M", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 8, }, }, ], @@ -7021,12 +8951,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 9, }, "variables": Array [], } @@ -7090,6 +9028,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7154,6 +9093,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -7218,6 +9158,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7263,6 +9204,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -7323,6 +9265,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7383,6 +9326,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7428,6 +9372,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -7488,6 +9433,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7548,6 +9494,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7615,6 +9562,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -7679,6 +9627,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -7743,6 +9692,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -7849,6 +9799,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -8060,6 +10011,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -8120,6 +10072,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -8180,6 +10133,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8235,6 +10189,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -8281,6 +10236,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -8300,6 +10256,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -8364,6 +10321,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -8428,6 +10386,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8495,6 +10454,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -8559,6 +10519,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -8623,6 +10584,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -8729,6 +10691,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -8940,6 +10903,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -9000,6 +10964,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -9060,6 +11025,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9166,6 +11132,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -9377,6 +11344,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -9437,6 +11405,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 12, }, @@ -9497,6 +11466,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9578,6 +11548,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -9699,6 +11670,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -9759,6 +11731,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -9819,6 +11792,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -9864,6 +11838,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -9924,6 +11899,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -9984,6 +11960,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10039,6 +12016,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -10113,6 +12091,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -10173,6 +12152,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -10233,6 +12213,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -10244,7 +12225,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 +12235,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, @@ -10264,7 +12245,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, @@ -10274,7 +12255,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 25, @@ -10288,8 +12269,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "arguments": Object { @@ -10297,7 +12283,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -10308,13 +12294,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, @@ -10328,27 +12354,72 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { "arguments": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 63, + 66, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, }, }, ], @@ -10359,8 +12430,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { "A": Object { @@ -10368,7 +12440,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -10408,7 +12480,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -10419,8 +12491,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 10, }, "variableMap": Object { "A": Object { @@ -10428,7 +12501,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { @@ -10468,7 +12541,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], @@ -10479,10 +12552,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 10, }, "variables": Array [], } @@ -10490,7 +12564,7 @@ Object { exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -10500,7 +12574,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -10510,7 +12584,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -10524,8 +12598,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -10533,7 +12612,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -10573,7 +12652,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -10584,8 +12703,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -10593,7 +12713,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -10633,7 +12753,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -10644,10 +12764,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -10655,7 +12776,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 +12786,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -10675,7 +12796,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -10686,11 +12807,38 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -10698,7 +12846,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -10738,7 +12886,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 9, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, }, }, ], @@ -10747,10 +12935,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -10758,7 +12951,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -10798,7 +12991,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -10807,12 +13000,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -10820,7 +13018,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 +13028,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -10840,7 +13038,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -10854,8 +13052,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "__P": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "A": Object { @@ -10863,7 +13066,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -10903,7 +13106,47 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "__P", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "__P", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + ], + "name": "__P", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -10914,8 +13157,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "A": Object { @@ -10923,7 +13167,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -10963,7 +13207,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -10974,10 +13218,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -11045,6 +13290,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -11152,6 +13398,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -11212,6 +13459,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11257,6 +13505,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -11317,6 +13566,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -11377,6 +13627,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11422,6 +13673,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -11482,6 +13734,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -11542,6 +13795,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11652,6 +13906,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -11677,6 +13932,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -11974,6 +14230,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 11, }, @@ -12020,6 +14277,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12130,6 +14388,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -12155,6 +14414,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12273,6 +14533,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -12358,6 +14619,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -12422,6 +14684,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12497,6 +14760,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -12512,6 +14776,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -12625,6 +14890,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12700,6 +14966,7 @@ Object { }, ], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -12715,6 +14982,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -12828,6 +15096,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12885,6 +15154,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -12904,6 +15174,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -12961,6 +15232,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -12980,6 +15252,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13051,6 +15324,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -13158,6 +15432,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -13218,6 +15493,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13289,6 +15565,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -13396,6 +15673,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -13456,6 +15734,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -13467,7 +15746,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 +15756,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -13487,7 +15766,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 15, @@ -13501,14 +15780,60 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 20, + 23, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -13516,12 +15841,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], }, @@ -13531,10 +15857,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -13542,7 +15869,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 +15879,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -13562,7 +15889,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 15, @@ -13576,14 +15903,103 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 0, + }, + "U": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "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": 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, @@ -13591,12 +16007,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -13606,10 +16023,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -13617,7 +16035,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 +16045,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -13637,7 +16055,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 7, @@ -13651,8 +16069,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -13660,7 +16083,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -13700,7 +16123,47 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 16, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, ], @@ -13711,8 +16174,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -13720,7 +16184,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -13760,7 +16224,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -13771,10 +16235,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -13782,7 +16247,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 +16257,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, @@ -13802,7 +16267,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 7, @@ -13816,8 +16281,16 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + "U": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -13825,7 +16298,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -13865,7 +16338,87 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$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, }, }, ], @@ -13876,8 +16429,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -13885,7 +16439,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -13925,7 +16479,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -13936,10 +16490,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } @@ -14007,6 +16562,7 @@ Object { ], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14114,6 +16670,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -14174,6 +16731,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14185,7 +16743,7 @@ Object { exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14195,7 +16753,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -14203,20 +16761,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 7, + 40, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "TestAlias": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "TestAlias", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 40, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "TestAlias", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + ], + "name": "TestAlias", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -14224,10 +16854,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -14235,7 +16866,7 @@ Object { exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14245,7 +16876,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -14253,20 +16884,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 7, + 51, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "TestClassProps": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "TestClassProps", + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 51, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "TestClassProps", + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + }, + ], + "name": "TestClassProps", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -14274,10 +16977,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -14285,7 +16989,7 @@ Object { exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -14295,7 +16999,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -14303,31 +17007,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 7, + 47, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 28, + 37, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "TestCallback": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "TestCallback", + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 47, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "TestCallback", + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + }, + ], + "name": "TestCallback", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -14335,7 +17142,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 +17152,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -14355,7 +17162,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 10, @@ -14368,9 +17175,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "a", @@ -14382,26 +17189,31 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 4, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "a": Object { - "$ref": 3, + "$ref": 4, }, "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -14412,11 +17224,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 +17304,11 @@ Object { "name": "a", "references": Array [ Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -14468,7 +17320,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 6, + "$ref": 7, }, "identifier": Object { "name": "obj", @@ -14493,8 +17345,9 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 7, + "$ref": 8, }, "variableMap": Object { "obj": Object { @@ -14502,7 +17355,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [ Object { @@ -14552,7 +17405,7 @@ Object { }, ], "scope": Object { - "$ref": 6, + "$ref": 7, }, }, ], @@ -14563,10 +17416,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [], } @@ -14608,6 +17462,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -14665,6 +17520,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -14735,6 +17591,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -14780,6 +17637,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -14849,6 +17707,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -14938,6 +17797,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -15016,6 +17876,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 10, }, @@ -15076,6 +17937,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15141,6 +18003,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15219,6 +18082,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15279,6 +18143,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15324,6 +18189,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15441,6 +18307,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15501,6 +18368,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15546,6 +18414,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -15663,6 +18532,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -15723,6 +18593,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -15734,7 +18605,7 @@ Object { exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 9, "block": Object { "range": Array [ 0, @@ -15744,7 +18615,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -15754,7 +18625,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -15767,9 +18638,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,26 +18690,31 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -15811,11 +18725,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 +18812,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -15866,8 +18827,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -15875,7 +18837,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { @@ -15915,7 +18877,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -15926,10 +18888,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [], } @@ -15937,7 +18900,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 +18910,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -15957,7 +18920,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -15971,8 +18934,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "arguments": Object { @@ -15980,7 +18948,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -15991,7 +18959,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, }, }, ], @@ -16002,8 +19010,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "compare": Object { @@ -16011,7 +19020,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -16051,7 +19060,7 @@ Object { "name": "compare", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -16062,10 +19071,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -16073,7 +19083,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 +19093,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, @@ -16093,7 +19103,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16106,9 +19116,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,26 +19168,31 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 3, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "X": Object { + "$ref": 2, + }, + }, "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, "b": Object { - "$ref": 2, + "$ref": 3, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -16150,11 +19203,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 +19290,11 @@ Object { "name": "b", "references": Array [ Object { - "$ref": 3, + "$ref": 6, }, ], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -16205,8 +19305,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 9, }, "variableMap": Object { "a": Object { @@ -16214,7 +19315,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [ Object { @@ -16254,7 +19355,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 8, }, }, ], @@ -16265,10 +19366,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 9, }, "variables": Array [], } @@ -16330,6 +19432,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -16408,6 +19511,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -16468,6 +19572,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16479,7 +19584,7 @@ Object { exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -16489,7 +19594,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -16499,7 +19604,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 0, @@ -16514,7 +19619,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "age", @@ -16539,7 +19644,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 +19678,15 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "age": Object { @@ -16576,7 +19703,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -16587,7 +19714,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -16627,11 +19754,11 @@ Object { "name": "name", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -16675,7 +19802,7 @@ Object { }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -16715,7 +19842,7 @@ Object { "name": "args", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -16724,10 +19851,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "message": Object { @@ -16735,7 +19867,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -16775,7 +19907,7 @@ Object { "name": "message", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -16784,12 +19916,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [], } @@ -16821,6 +19958,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16881,6 +20019,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16916,6 +20055,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -16976,6 +20116,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -16987,7 +20128,7 @@ Object { exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -16997,7 +20138,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -17005,31 +20146,228 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], + }, + Object { + "$id": 5, + "block": Object { + "range": Array [ + 29, + 55, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Y", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + "B": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "B", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 29, + 55, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "B", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + ], + "name": "B", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -17037,7 +20375,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 +20385,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17055,31 +20393,160 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "X": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -17087,7 +20554,7 @@ Object { exports[`typescript fixtures/basics/interface-extends.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17097,7 +20564,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17105,216 +20572,232 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 30, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 1, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` +exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 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", + "typeMap": Object {}, + "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, }, @@ -17323,23 +20806,66 @@ Object { }, ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 34, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, @@ -17348,149 +20874,167 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 50, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 34, + 22, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 34, + 22, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -17498,49 +21042,1354 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 1, + "$id": 21, "block": Object { "range": Array [ 0, - 22, + 297, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 20, "block": Object { "range": Array [ 0, - 22, + 297, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, + "childScopes": Array [ + Object { + "$id": 19, + "block": Object { + "range": Array [ + 0, + 295, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "bax", + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 171, + 172, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 174, + 175, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 177, + 178, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "loo", + "range": Array [ + 192, + 195, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 198, + 199, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 201, + 202, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 12, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 225, + 226, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 13, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 228, + 229, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 14, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "c", + "range": Array [ + 231, + 232, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 15, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 250, + 251, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 16, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 253, + 255, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 17, + "from": Object { + "$ref": 19, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 278, + 279, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 18, + "from": Object { + "$ref": 19, + }, + "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, + }, + ], + "type": "interface", + "typeMap": Object { + "F": Object { + "$ref": 2, + }, + "J": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 20, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 20, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "J", + "range": Array [ + 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", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 21, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 20, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 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": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + Object { + "$ref": 12, + }, + Object { + "$ref": 13, + }, + Object { + "$ref": 14, + }, + Object { + "$ref": 15, + }, + Object { + "$ref": 16, + }, + Object { + "$ref": 17, + }, + Object { + "$ref": 18, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 21, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "y", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "typeMap": Object { + "Test": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 33, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 33, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 36, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "J", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "variables": Array [], + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 36, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 14, + 17, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Test": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -17548,10 +22397,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -17559,7 +22409,7 @@ Object { exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17569,7 +22419,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17577,31 +22427,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 87, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Test": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 87, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "Test", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -17609,7 +22562,7 @@ Object { exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, @@ -17619,7 +22572,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 7, "block": Object { "range": Array [ 0, @@ -17627,31 +22580,250 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 61, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 48, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 44, + 47, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object { + "test": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 7, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "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 [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } @@ -17659,7 +22831,7 @@ Object { exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, @@ -17669,7 +22841,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 5, "block": Object { "range": Array [ 0, @@ -17677,31 +22849,186 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 81, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 59, + 71, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 73, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object { + "test": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 6, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 5, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 81, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } @@ -17709,7 +23036,7 @@ Object { exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17719,7 +23046,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -17727,20 +23054,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "test": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -17748,10 +23147,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -17759,7 +23159,7 @@ Object { exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17769,7 +23169,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17777,31 +23177,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "x": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -17809,7 +23312,7 @@ Object { exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, @@ -17819,7 +23322,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17830,11 +23333,74 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 17, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object { "nestedArray": Object { @@ -17842,7 +23408,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [ Object { @@ -17888,7 +23454,7 @@ Object { "name": "nestedArray", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 4, }, }, ], @@ -17897,12 +23463,23 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } @@ -17910,7 +23487,7 @@ Object { exports[`typescript fixtures/basics/never-type-param.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -17920,7 +23497,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -17935,7 +23512,24 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 2, + "$ref": 3, + }, + "identifier": Object { + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, }, "identifier": Object { "name": "Observable", @@ -17954,10 +23548,14 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -17965,7 +23563,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -18011,7 +23609,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -18024,12 +23622,16 @@ Object { Object { "$ref": 1, }, + Object { + "$ref": 2, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -18037,7 +23639,7 @@ Object { exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -18047,7 +23649,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -18057,7 +23659,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -18072,7 +23674,24 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 8, + "$ref": 9, + }, + "identifier": Object { + "name": "Entity", + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 9, }, "identifier": Object { "name": "validateEntity", @@ -18087,9 +23706,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { "name": "e", @@ -18106,9 +23725,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 7, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { "name": "s", @@ -18131,9 +23750,9 @@ Object { }, }, Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { "name": "e", @@ -18154,10 +23773,14 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "arguments": Object { @@ -18171,7 +23794,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -18182,7 +23805,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, Object { @@ -18222,14 +23845,14 @@ Object { "name": "e", "references": Array [ Object { - "$ref": 5, + "$ref": 6, }, Object { - "$ref": 7, + "$ref": 8, }, ], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, Object { @@ -18275,11 +23898,11 @@ Object { "name": "s", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -18292,10 +23915,14 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "processEntity": Object { @@ -18303,7 +23930,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -18343,7 +23970,7 @@ Object { "name": "processEntity", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -18356,12 +23983,16 @@ Object { Object { "$ref": 4, }, + Object { + "$ref": 5, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -18393,6 +24024,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -18508,6 +24140,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18553,6 +24186,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -18593,6 +24227,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -18653,6 +24288,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -18713,6 +24349,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -18724,7 +24361,7 @@ Object { exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { - "$id": 12, + "$id": 14, "block": Object { "range": Array [ 0, @@ -18734,7 +24371,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, @@ -18744,7 +24381,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 29, @@ -18758,8 +24395,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "arguments": Object { @@ -18767,7 +24409,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -18778,13 +24420,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, @@ -18798,33 +24480,78 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "T": Object { + "$ref": 6, + }, + }, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "arguments": Object { - "$ref": 4, + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { - "$id": 4, + "$id": 5, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 68, + 71, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [], + "scope": Object { + "$ref": 7, }, }, ], }, Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 109, @@ -18838,33 +24565,34 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "arguments": Object { - "$ref": 6, + "$ref": 8, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [ Object { - "$id": 6, + "$id": 8, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 9, }, }, ], }, Object { - "$id": 10, + "$id": 12, "block": Object { "range": Array [ 147, @@ -18878,34 +24606,35 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "arguments": Object { - "$ref": 8, + "$ref": 10, }, "x": Object { - "$ref": 9, + "$ref": 11, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 12, }, "variables": Array [ Object { - "$id": 8, + "$id": 10, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, Object { - "$id": 9, + "$id": 11, "defs": Array [ Object { "name": Object { @@ -18941,7 +24670,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, ], @@ -18953,7 +24682,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 11, + "$ref": 13, }, "identifier": Object { "name": "foo", @@ -18978,8 +24707,9 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 12, + "$ref": 14, }, "variableMap": Object { "foo": Object { @@ -18987,7 +24717,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 13, }, "variables": Array [ Object { @@ -19037,7 +24767,7 @@ Object { }, ], "scope": Object { - "$ref": 11, + "$ref": 13, }, }, ], @@ -19048,10 +24778,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 14, }, "variables": Array [], } @@ -19083,6 +24814,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -19098,6 +24830,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19109,7 +24842,7 @@ Object { exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19119,7 +24852,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -19129,7 +24862,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -19139,12 +24872,35 @@ Object { }, "childScopes": Array [], "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "abc": Object { @@ -19155,7 +24911,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -19166,7 +24922,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, Object { @@ -19206,7 +24962,7 @@ Object { "name": "abc", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -19215,10 +24971,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "test": Object { @@ -19226,7 +24987,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -19266,7 +25027,7 @@ Object { "name": "test", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -19275,12 +25036,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } @@ -19288,7 +25054,7 @@ Object { exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19298,7 +25064,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19306,31 +25072,228 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "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", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 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 [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object { + "Result": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "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", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -19338,7 +25301,7 @@ Object { exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19348,7 +25311,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19356,31 +25319,228 @@ Object { ], "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", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 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", + "typeMap": Object { + "Result": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "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", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -19388,7 +25548,7 @@ Object { exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -19398,7 +25558,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -19406,20 +25566,92 @@ Object { ], "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 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, @@ -19427,10 +25659,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -19488,6 +25721,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -19558,6 +25792,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19623,6 +25858,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -19713,6 +25949,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -19783,6 +26020,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -19794,7 +26032,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-arrow-function.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -19804,7 +26042,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -19814,7 +26052,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 17, @@ -19829,7 +26067,24 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, }, "identifier": Object { "name": "x", @@ -19846,10 +26101,15 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "x": Object { @@ -19857,7 +26117,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -19897,11 +26157,11 @@ Object { "name": "x", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -19913,7 +26173,7 @@ Object { Object { "$id": 1, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { "name": "isString", @@ -19936,10 +26196,15 @@ Object { }, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "isString": Object { @@ -19947,7 +26212,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -19997,7 +26262,7 @@ Object { }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -20006,12 +26271,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -20019,7 +26289,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-function.src 1`] = ` Object { - "$id": 6, + "$id": 7, "block": Object { "range": Array [ 0, @@ -20029,7 +26299,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, @@ -20039,7 +26309,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -20054,7 +26324,24 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 4, + "$ref": 5, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, }, "identifier": Object { "name": "x", @@ -20071,10 +26358,15 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { "arguments": Object { @@ -20085,7 +26377,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -20096,7 +26388,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, Object { @@ -20136,11 +26428,11 @@ Object { "name": "x", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, ], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -20149,10 +26441,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { "isString": Object { @@ -20160,7 +26457,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -20200,7 +26497,7 @@ Object { "name": "isString", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -20209,12 +26506,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } @@ -20222,7 +26524,7 @@ Object { exports[`typescript fixtures/basics/type-guard-in-interface.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -20232,7 +26534,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, @@ -20240,31 +26542,160 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 56, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "node", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "node", + "range": Array [ + 39, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } @@ -20340,6 +26771,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -20404,6 +26836,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -20419,6 +26852,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -20486,6 +26920,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -20546,6 +26981,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -20557,7 +26993,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` Object { - "$id": 8, + "$id": 12, "block": Object { "range": Array [ 0, @@ -20567,7 +27003,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 11, "block": Object { "range": Array [ 0, @@ -20577,7 +27013,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 44, @@ -20591,33 +27027,78 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object { + "A": Object { + "$ref": 5, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 11, }, "variableMap": Object { "arguments": Object { - "$ref": 3, + "$ref": 4, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { - "$id": 3, + "$id": 4, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 56, + 81, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 6, }, }, ], }, Object { - "$id": 6, + "$id": 10, "block": Object { "range": Array [ 88, @@ -20628,30 +27109,97 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 126, + 129, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 9, + }, + ], "type": "function", + "typeMap": Object { + "A": Object { + "$ref": 8, + }, + }, "upperScope": Object { - "$ref": 7, + "$ref": 11, }, "variableMap": Object { "arguments": Object { - "$ref": 5, + "$ref": 7, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 10, }, "variables": Array [ Object { - "$id": 5, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 10, + }, + }, + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 100, + 131, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 10, }, }, ], @@ -20663,7 +27211,24 @@ Object { Object { "$id": 2, "from": Object { - "$ref": 7, + "$ref": 11, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 11, }, "identifier": Object { "name": "foo", @@ -20682,10 +27247,17 @@ Object { Object { "$ref": 2, }, + Object { + "$ref": 3, + }, + Object { + "$ref": 9, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 12, }, "variableMap": Object { "bar": Object { @@ -20696,7 +27268,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 11, }, "variables": Array [ Object { @@ -20736,7 +27308,7 @@ Object { "name": "bar", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 11, }, }, Object { @@ -20776,7 +27348,7 @@ Object { "name": "baz", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 11, }, }, ], @@ -20789,12 +27361,19 @@ Object { Object { "$ref": 2, }, + Object { + "$ref": 3, + }, + Object { + "$ref": 9, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 12, }, "variables": Array [], } @@ -20802,7 +27381,7 @@ Object { exports[`typescript fixtures/basics/type-parameters-comments-heritage.src 1`] = ` Object { - "$id": 9, + "$id": 23, "block": Object { "range": Array [ 0, @@ -20812,7 +27391,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 22, "block": Object { "range": Array [ 0, @@ -20822,7 +27401,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, @@ -20833,23 +27412,48 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 7, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 7, + }, + }, "upperScope": Object { - "$ref": 8, + "$ref": 22, }, "variableMap": Object { "foo": Object { - "$ref": 4, + "$ref": 6, }, }, "variableScope": Object { - "$ref": 8, + "$ref": 22, }, "variables": Array [ Object { - "$id": 4, + "$id": 6, "defs": Array [ Object { "name": Object { @@ -20885,13 +27489,57 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 9, + }, + }, + Object { + "$id": 7, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 34, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, }, }, ], }, Object { - "$id": 7, + "$id": 13, "block": Object { "range": Array [ 75, @@ -20902,59 +27550,362 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 12, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 149, + 150, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 11, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "class", + "typeMap": Object { + "A": Object { + "$ref": 11, + }, + }, "upperScope": Object { - "$ref": 8, + "$ref": 22, }, "variableMap": Object { "foo2": Object { - "$ref": 6, + "$ref": 10, + }, + }, + "variableScope": Object { + "$ref": 22, + }, + "variables": Array [ + Object { + "$id": 10, + "defs": Array [ + Object { + "name": Object { + "name": "foo2", + "range": Array [ + 81, + 85, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 75, + 164, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo2", + "range": Array [ + 81, + 85, + ], + "type": "Identifier", + }, + ], + "name": "foo2", + "references": Array [], + "scope": Object { + "$ref": 13, + }, + }, + Object { + "$id": 11, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 86, + 124, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [ + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + ], + }, + Object { + "$id": 17, + "block": Object { + "range": Array [ + 165, + 244, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 15, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "bar2", + "range": Array [ + 212, + 216, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": undefined, + }, + Object { + "$id": 16, + "from": Object { + "$ref": 17, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 229, + 230, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 14, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 15, + }, + ], + "type": "interface", + "typeMap": Object { + "A": Object { + "$ref": 14, + }, + }, + "upperScope": Object { + "$ref": 22, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 22, + }, + "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": 21, + "block": Object { + "range": Array [ + 245, + 338, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 19, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 307, + 310, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 20, + "from": Object { + "$ref": 21, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 323, + 324, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 18, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 19, + }, + ], + "type": "interface", + "typeMap": Object { + "A": Object { + "$ref": 18, }, }, + "upperScope": Object { + "$ref": 22, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 22, }, "variables": Array [ Object { - "$id": 6, + "$id": 18, "defs": Array [ Object { "name": Object { - "name": "foo2", + "name": "A", "range": Array [ - 81, - 85, + 272, + 273, ], "type": "Identifier", }, "node": Object { "range": Array [ - 75, - 164, + 260, + 298, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo2", + "name": "A", "range": Array [ - 81, - 85, + 272, + 273, ], "type": "Identifier", }, ], - "name": "foo2", - "references": Array [], + "name": "A", + "references": Array [ + Object { + "$ref": 20, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 21, }, }, ], @@ -20964,9 +27915,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 22, }, "identifier": Object { "name": "bar", @@ -20981,9 +27932,9 @@ Object { "writeExpr": undefined, }, Object { - "$id": 3, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 22, }, "identifier": Object { "name": "bar", @@ -21000,15 +27951,23 @@ Object { ], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, Object { - "$ref": 3, + "$ref": 5, }, ], "type": "module", + "typeMap": Object { + "bar": Object { + "$ref": 2, + }, + "bar2": Object { + "$ref": 3, + }, + }, "upperScope": Object { - "$ref": 9, + "$ref": 23, }, "variableMap": Object { "foo": Object { @@ -21019,7 +27978,7 @@ Object { }, }, "variableScope": Object { - "$ref": 8, + "$ref": 22, }, "variables": Array [ Object { @@ -21059,7 +28018,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 22, }, }, Object { @@ -21099,7 +28058,95 @@ Object { "name": "foo2", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 22, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 175, + 178, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 165, + 244, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 175, + 178, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [ + Object { + "$ref": 19, + }, + ], + "scope": Object { + "$ref": 22, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "bar2", + "range": Array [ + 255, + 259, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 245, + 338, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar2", + "range": Array [ + 255, + 259, + ], + "type": "Identifier", + }, + ], + "name": "bar2", + "references": Array [ + Object { + "$ref": 15, + }, + ], + "scope": Object { + "$ref": 22, }, }, ], @@ -21110,17 +28157,18 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 4, }, Object { - "$ref": 3, + "$ref": 5, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 23, }, "variables": Array [], } @@ -21128,7 +28176,7 @@ Object { exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -21138,7 +28186,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -21148,7 +28196,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21159,11 +28207,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "interop", + "range": Array [ + 36, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "AudioBufferList": Object { @@ -21171,7 +28242,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -21211,10 +28282,387 @@ Object { "name": "AudioBufferList", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "AudioBufferList": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "AudioBufferList", + "range": Array [ + 6, + 21, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 77, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AudioBufferList", + "range": Array [ + 6, + 21, + ], + "type": "Identifier", + }, + ], + "name": "AudioBufferList", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "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, + }, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -21222,56 +28670,57 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "AudioBufferList": Object { + "typeMap": Object { + "Foo": Object { "$ref": 0, }, }, - "variableScope": Object { + "upperScope": Object { "$ref": 3, }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, "variables": Array [ Object { "$id": 0, "defs": Array [ Object { "name": Object { - "name": "AudioBufferList", + "name": "Foo", "range": Array [ - 6, - 21, + 5, + 8, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 77, + 16, ], - "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": 2, }, }, ], @@ -21282,49 +28731,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 18, + 17, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 18, + 17, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 16, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -21332,49 +28854,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 19, + 16, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 19, + 16, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -21382,49 +28977,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 17, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 17, + 18, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$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, @@ -21432,49 +29100,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 17, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 17, + 18, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$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, @@ -21482,49 +29223,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 16, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 16, + 18, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$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, @@ -21532,18 +29346,19 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21553,7 +29368,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -21561,20 +29376,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -21582,49 +29469,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-true.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 [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -21632,49 +29592,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 18, + 21, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 18, + 21, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 20, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 20, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -21682,49 +29715,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 18, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 18, + 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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 18, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -21732,18 +29838,19 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -21753,7 +29860,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -21761,20 +29868,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -21782,210 +29961,280 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` +exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, - 21, + 58, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 7, "block": Object { "range": Array [ 0, - 21, + 58, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 40, + 43, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + ], "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 7, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 57, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$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-method-signature.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 58, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 3, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } @@ -21993,7 +30242,7 @@ Object { exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -22003,7 +30252,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -22011,31 +30260,212 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 89, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "onclick", + "range": Array [ + 40, + 79, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "this", + "range": Array [ + 50, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 62, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "Event", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", + "typeMap": Object { + "UIElement": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "UIElement", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 89, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "UIElement", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + ], + "name": "UIElement", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -22043,7 +30473,7 @@ Object { exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22053,7 +30483,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22061,20 +30491,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 23, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "A": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 23, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -22082,10 +30584,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -22117,6 +30620,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -22183,6 +30687,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22218,6 +30723,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -22382,6 +30888,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22393,7 +30900,7 @@ Object { exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -22403,7 +30910,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -22414,11 +30921,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "foo": Object { @@ -22426,7 +30956,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -22472,7 +31002,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -22481,12 +31011,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -22569,6 +31104,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -22692,6 +31228,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22727,6 +31264,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -22793,6 +31331,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -22838,6 +31377,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -22898,6 +31438,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -22958,6 +31499,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23003,6 +31545,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -23063,6 +31606,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -23123,6 +31667,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23168,6 +31713,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -23271,6 +31817,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -23331,6 +31878,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23376,6 +31924,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "empty-function", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -23391,6 +31940,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -23451,6 +32001,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23462,7 +32013,7 @@ Object { exports[`typescript fixtures/declare/interface.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -23472,7 +32023,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -23480,20 +32031,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -23501,10 +32124,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -23546,6 +32170,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -23561,6 +32186,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -23621,6 +32247,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23666,6 +32293,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -23681,6 +32309,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -23741,6 +32370,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23752,7 +32382,7 @@ Object { exports[`typescript fixtures/declare/type-alias.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -23762,7 +32392,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -23770,20 +32400,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 25, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -23791,10 +32493,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -23826,6 +32529,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -23892,6 +32596,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -23947,6 +32652,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -24000,6 +32706,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -24064,6 +32771,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -24128,6 +32836,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24183,6 +32892,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -24236,6 +32946,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -24300,6 +33011,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -24364,6 +33076,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24419,6 +33132,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -24472,6 +33186,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -24536,6 +33251,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -24600,6 +33316,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24675,6 +33392,7 @@ Object { ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -24775,6 +33493,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -24839,6 +33558,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -24903,6 +33623,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -24948,6 +33669,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -25030,6 +33752,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25094,6 +33817,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25139,6 +33863,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -25221,6 +33946,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25285,6 +34011,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25340,6 +34067,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25393,6 +34121,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25457,6 +34186,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -25521,6 +34251,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25576,6 +34307,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25629,6 +34361,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25693,6 +34426,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -25757,6 +34491,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -25812,6 +34547,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -25865,6 +34601,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -25929,6 +34666,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -25993,6 +34731,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26048,6 +34787,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -26101,6 +34841,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -26165,6 +34906,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -26229,6 +34971,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26306,6 +35049,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -26384,6 +35128,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -26448,6 +35193,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -26512,6 +35258,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -26523,7 +35270,7 @@ Object { exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, @@ -26533,7 +35280,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, @@ -26543,7 +35290,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, @@ -26553,7 +35300,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 8, "block": Object { "range": Array [ 31, @@ -26568,7 +35315,7 @@ Object { Object { "$id": 4, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "Inject", @@ -26585,7 +35332,7 @@ Object { Object { "$id": 5, "from": Object { - "$ref": 7, + "$ref": 8, }, "identifier": Object { "name": "APP_CONFIG", @@ -26602,7 +35349,24 @@ Object { Object { "$id": 6, "from": Object { - "$ref": 7, + "$ref": 8, + }, + "identifier": Object { + "name": "AppConfig", + "range": Array [ + 60, + 69, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, }, "identifier": Object { "name": "config", @@ -26626,10 +35390,14 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 8, + "$ref": 9, }, "variableMap": Object { "arguments": Object { @@ -26640,7 +35408,7 @@ Object { }, }, "variableScope": Object { - "$ref": 7, + "$ref": 8, }, "variables": Array [ Object { @@ -26651,7 +35419,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, Object { @@ -26691,11 +35459,11 @@ Object { "name": "config", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 7, + "$ref": 8, }, }, ], @@ -26711,10 +35479,14 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "Service": Object { @@ -26722,7 +35494,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -26762,7 +35534,7 @@ Object { "name": "Service", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -26778,10 +35550,14 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { "Service": Object { @@ -26789,7 +35565,7 @@ Object { }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -26829,7 +35605,7 @@ Object { "name": "Service", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -26845,12 +35621,16 @@ Object { Object { "$ref": 5, }, + Object { + "$ref": 6, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } @@ -26924,6 +35704,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27002,6 +35783,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27066,6 +35848,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -27130,6 +35913,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27207,6 +35991,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -27285,6 +36070,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27349,6 +36135,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -27413,6 +36200,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27509,6 +36297,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27591,6 +36380,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -27655,6 +36445,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -27719,6 +36510,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -27815,6 +36607,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -27897,6 +36690,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -27961,6 +36755,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 9, }, @@ -28025,6 +36820,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28102,6 +36898,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -28180,6 +36977,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -28244,6 +37042,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -28308,6 +37107,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28385,6 +37185,7 @@ Object { }, ], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -28463,6 +37264,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -28527,6 +37329,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 8, }, @@ -28591,6 +37394,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28698,6 +37502,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -28768,6 +37573,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 7, }, @@ -28838,6 +37644,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -28925,6 +37732,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -28992,6 +37800,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -29059,6 +37868,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29146,6 +37956,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -29213,6 +38024,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -29280,6 +38092,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29367,6 +38180,7 @@ Object { }, ], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -29434,6 +38248,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -29501,6 +38316,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29546,6 +38362,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -29606,6 +38423,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29666,6 +38484,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -29677,7 +38496,7 @@ Object { exports[`typescript fixtures/errorRecovery/class-empty-extends-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -29687,7 +38506,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -29697,7 +38516,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -29708,11 +38527,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -29720,7 +38562,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -29760,7 +38602,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -29769,10 +38611,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -29780,7 +38627,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -29820,7 +38667,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -29829,12 +38676,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -29876,6 +38728,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -29958,6 +38811,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -30022,6 +38876,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30033,7 +38888,7 @@ Object { exports[`typescript fixtures/errorRecovery/class-multiple-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, @@ -30043,7 +38898,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -30053,7 +38908,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -30064,11 +38919,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "a": Object { @@ -30076,7 +38954,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -30116,7 +38994,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -30125,10 +39003,15 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "a": Object { @@ -30136,7 +39019,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -30176,7 +39059,7 @@ Object { "name": "a", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -30185,12 +39068,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } @@ -30232,6 +39120,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "enum", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -30247,6 +39136,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30307,6 +39197,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30352,6 +39243,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30383,6 +39275,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -30443,6 +39336,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30454,7 +39348,7 @@ Object { exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -30464,7 +39358,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -30472,20 +39366,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "M": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "M", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 22, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "M", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + ], + "name": "M", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -30493,10 +39459,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -30554,6 +39521,7 @@ Object { ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -30624,6 +39592,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30635,7 +39604,7 @@ Object { exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -30645,7 +39614,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -30656,11 +39625,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "foo": Object { @@ -30668,7 +39660,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -30714,7 +39706,7 @@ Object { "name": "foo", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -30723,12 +39715,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -30782,6 +39779,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -30801,6 +39799,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -30847,102 +39846,454 @@ Object { ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "module", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-parameters.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "f1": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "f1", + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "f1", + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + }, + ], + "name": "f1", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-arrow-function.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "f1": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "f1", + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 18, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "f1", + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + }, + ], + "name": "f1", + "references": Array [], + "scope": Object { + "$ref": 3, + }, }, ], - "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", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-constructor.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 19, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 19, + 35, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 18, + 34, ], - "type": "FunctionDeclaration", + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "arguments": Object { + "foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [ Object { "$id": 1, - "defs": Array [], + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 34, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -30953,16 +40304,17 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { - "f1": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -30970,39 +40322,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f1", + "name": "foo", "range": Array [ + 6, 9, - 11, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 18, + 34, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f1", + "name": "foo", "range": Array [ + 6, 9, - 11, ], "type": "Identifier", }, ], - "name": "f1", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -31013,44 +40365,45 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-arrow-function.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-function-expression.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 19, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 19, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ - 0, - 18, + 12, + 27, ], - "type": "FunctionDeclaration", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, @@ -31058,27 +40411,28 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "arguments": Object { - "$ref": 1, + "$ref": 2, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -31086,19 +40440,46 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 27, + ], + "type": "FunctionExpression", + }, + }, + ], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { - "f1": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -31106,39 +40487,49 @@ Object { "defs": Array [ Object { "name": Object { - "name": "f1", + "name": "foo", "range": Array [ + 6, 9, - 11, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 18, + 27, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "f1", + "name": "foo", "range": Array [ + 6, 9, - 11, ], "type": "Identifier", }, ], - "name": "f1", - "references": Array [], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -31149,22 +40540,23 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-constructor.src 1`] = ` +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method.src 1`] = ` Object { "$id": 6, "block": Object { "range": Array [ 0, - 35, + 28, ], "type": "Program", }, @@ -31174,7 +40566,7 @@ Object { "block": Object { "range": Array [ 0, - 35, + 28, ], "type": "Program", }, @@ -31184,7 +40576,7 @@ Object { "block": Object { "range": Array [ 0, - 34, + 27, ], "type": "ClassDeclaration", }, @@ -31193,8 +40585,8 @@ Object { "$id": 3, "block": Object { "range": Array [ + 18, 25, - 32, ], "type": "FunctionExpression", }, @@ -31204,6 +40596,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -31235,6 +40628,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -31262,7 +40656,7 @@ Object { "node": Object { "range": Array [ 0, - 34, + 27, ], "type": "ClassDeclaration", }, @@ -31295,6 +40689,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -31314,37 +40709,283 @@ Object { "name": Object { "name": "foo", "range": Array [ - 6, - 9, + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 27, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 30, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 72, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 7, + 72, + ], + "type": "TSEnumDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "enum", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "X": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 68, + 69, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 34, + 7, + 72, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "ClassName", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "X", "range": Array [ - 6, - 9, + 68, + 69, ], "type": "Identifier", }, ], - "name": "foo", + "name": "X", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 2, }, }, ], @@ -31355,118 +40996,79 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-function-expression.src 1`] = ` +exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 28, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 28, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ - 12, - 27, + 0, + 48, ], - "type": "FunctionExpression", + "type": "TSTypeAliasDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - 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", - }, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { + "typeMap": Object { "foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [ Object { @@ -31476,26 +41078,20 @@ Object { "name": Object { "name": "foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 27, + 48, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", }, - "type": "Variable", + "parent": null, + "type": "TypeAliasName", }, ], "eslintUsed": undefined, @@ -31503,20 +41099,16 @@ Object { Object { "name": "foo", "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", }, ], "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 2, }, }, ], @@ -31527,145 +41119,61 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ 0, - 28, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 2, "block": Object { "range": Array [ 0, - 28, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, - 27, + 26, ], - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, - "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, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "interface", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "foo": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$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, - 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, @@ -31673,16 +41181,17 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "foo": Object { + "typeMap": Object { + "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 2, }, "variables": Array [ Object { @@ -31690,39 +41199,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, + 26, ], - "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": 2, }, }, ], @@ -31733,49 +41242,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 30, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 30, + 28, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "d": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "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, @@ -31783,22 +41365,23 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { "$id": 3, "block": Object { "range": Array [ 0, - 72, + 51, ], "type": "Program", }, @@ -31808,7 +41391,7 @@ Object { "block": Object { "range": Array [ 0, - 72, + 51, ], "type": "Program", }, @@ -31817,17 +41400,18 @@ Object { "$id": 1, "block": Object { "range": Array [ - 7, - 72, + 0, + 49, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "enum", + "type": "interface", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -31843,14 +41427,15 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "X": Object { + "typeMap": Object { + "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { "$ref": 2, }, @@ -31860,36 +41445,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "Foo", "range": Array [ - 68, - 69, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 72, + 0, + 49, ], - "type": "TSEnumDeclaration", + "type": "TSInterfaceDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "InterfaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "Foo", "range": Array [ - 68, - 69, + 10, + 13, ], "type": "Identifier", }, ], - "name": "X", + "name": "Foo", "references": Array [], "scope": Object { "$ref": 2, @@ -31903,6 +41488,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -31912,90 +41498,112 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 49, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 49, + 52, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", - "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", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32003,49 +41611,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 28, + 54, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 28, + 54, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 52, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 52, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32053,18 +41734,19 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32074,7 +41756,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -32082,20 +41764,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32103,49 +41857,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 52, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 52, + 51, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32153,168 +41980,478 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 54, + 52, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 54, + 52, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 29, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 51, + 53, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 51, + 53, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 51, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 30, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 51, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-protected.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 51, + 53, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 51, + 53, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 51, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 30, + 41, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 51, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -32324,7 +42461,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -32332,170 +42469,577 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 29, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 53, + 50, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 53, + 50, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 27, + 38, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 40, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32503,49 +43047,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 50, + 40, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 50, + 40, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 38, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32553,49 +43170,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 41, + 42, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 41, + 42, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 40, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32603,49 +43293,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 39, + 41, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 39, + 41, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 39, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32653,49 +43416,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-static.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 40, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 40, + 39, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32703,49 +43539,122 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-property-with-default-value.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 42, + 39, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 42, + 39, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 38, + ], + "type": "TSInterfaceDeclaration", + }, + "parent": null, + "type": "InterfaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -32753,47 +43662,79 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-with-no-body.src 1`] = `"'{' expected."`; + +exports[`typescript fixtures/errorRecovery/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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, "variables": Array [], }, @@ -32801,49 +43742,83 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-property-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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 1, + "$ref": 2, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, "variables": Array [], }, @@ -32851,24 +43826,29 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/interface-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 +43858,7 @@ Object { "block": Object { "range": Array [ 0, - 39, + 5, ], "type": "Program", }, @@ -32888,6 +43868,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 1, }, @@ -32903,6 +43884,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -32912,25 +43894,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 +43921,74 @@ Object { Object { "$id": 0, "from": Object { - "$ref": 1, + "$ref": 3, }, "identifier": Object { - "name": "a", + "name": "A", "range": Array [ - 2, + 4, + 5, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 0, 3, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": null, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 8, 10, + 13, ], - "type": "ObjectExpression", + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], "throughReferences": Array [ Object { "$ref": 0, }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], }, @@ -32985,34 +44000,41 @@ Object { Object { "$ref": 0, }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/errorRecovery/object-optional-not-allowed.src 1`] = ` +exports[`typescript fixtures/expressions/new-expression-type-arguments.src 1`] = ` Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 12, + 21, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 12, + 21, ], "type": "Program", }, @@ -33021,43 +44043,138 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 1, + "$ref": 4, }, "identifier": Object { "name": "a", "range": Array [ - 2, - 3, + 6, + 7, ], "type": "Identifier", }, "kind": "w", - "resolved": null, + "resolved": Object { + "$ref": 0, + }, "writeExpr": Object { "range": Array [ - 8, 10, + 20, ], - "type": "ObjectExpression", + "type": "NewExpression", }, }, + Object { + "$id": 2, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "B", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, ], "throughReferences": Array [ Object { - "$ref": 0, + "$ref": 2, + }, + Object { + "$ref": 3, }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 5, + }, + "variableMap": Object { + "a": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 20, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 21, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -33065,76 +44182,30 @@ 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", + "typeMap": Object {}, "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 +44215,7 @@ Object { "block": Object { "range": Array [ 0, - 24, + 14, ], "type": "Program", }, @@ -33175,10 +44246,10 @@ Object { "$ref": 2, }, "identifier": Object { - "name": "foo", + "name": "bar", "range": Array [ - 10, - 13, + 4, + 7, ], "type": "Identifier", }, @@ -33196,6 +44267,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -33218,6 +44290,136 @@ Object { }, ], "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 30, + 56, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -33227,89 +44429,215 @@ Object { } `; -exports[`typescript fixtures/expressions/new-expression-type-arguments.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` Object { - "$id": 4, + "$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", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "selector": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "selector", + "range": Array [ + 48, + 64, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 32, + 82, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "selector", + "range": Array [ + 48, + 64, + ], + "type": "Identifier", + }, + ], + "name": "selector", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "block", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, }, - }, - 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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { - "a": Object { + "d3": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -33317,49 +44645,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 +44688,27 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 2, + "$ref": 3, }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/expressions/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 +44718,19 @@ 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", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { @@ -33440,71 +44738,376 @@ 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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, + "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", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object {}, + "variableMap": Object { + "global": Object { + "$ref": 0, + }, + }, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "global", + "range": Array [ + 36, + 42, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 51, + ], + "type": "TSModuleDeclaration", + }, + "parent": null, + "type": "NamespaceName", + }, + Object { + "name": Object { + "name": "global", + "range": Array [ + 74, + 80, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 56, + 89, + ], + "type": "TSModuleDeclaration", + }, + "parent": null, + "type": "NamespaceName", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "global", + "range": Array [ + 36, + 42, + ], + "type": "Identifier", + }, + Object { + "name": "global", + "range": Array [ + 74, + 80, + ], + "type": "Identifier", + }, + ], + "name": "global", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], } `; -exports[`typescript fixtures/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` Object { - "$id": 3, + "$id": 11, "block": Object { "range": Array [ 0, - 57, + 114, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 10, "block": Object { "range": Array [ 0, - 57, + 114, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ - 30, - 56, + 13, + 112, ], "type": "TSModuleBlock", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 34, + 73, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 58, + 66, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "C": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 34, + 73, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + Object { + "$id": 8, + "block": Object { + "range": Array [ + 93, + 110, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 7, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 7, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "block", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 10, }, "variableMap": Object { - "fs": Object { + "C": Object { "$ref": 0, }, + "bar": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [ Object { @@ -33512,45 +45115,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, }, }, ], @@ -33561,12 +45198,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 11, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [], }, @@ -33576,111 +45214,337 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 11, }, "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` Object { - "$id": 6, + "$id": 16, "block": Object { "range": Array [ 0, - 84, + 231, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 15, "block": Object { "range": Array [ 0, - 84, + 231, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 14, "block": Object { "range": Array [ - 21, - 84, + 9, + 231, ], "type": "TSModuleBlock", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 10, "block": Object { "range": Array [ - 32, - 82, + 56, + 135, ], - "type": "TSDeclareFunction", + "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 89, + 129, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 6, + }, + "x": Object { + "$ref": 7, + }, + "y": Object { + "$ref": 8, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 6, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 7, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 97, + 106, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 89, + 129, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 97, + 106, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 8, + "defs": Array [ + Object { + "name": Object { + "name": "y", + "range": Array [ + 115, + 124, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 89, + 129, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "y", + "range": Array [ + 115, + 124, + ], + "type": "Identifier", + }, + ], + "name": "y", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "empty-function", + "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, + "$ref": 14, }, "variableMap": Object { - "selector": Object { - "$ref": 2, + "Point": Object { + "$ref": 5, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 15, }, "variables": Array [ Object { - "$id": 2, + "$id": 5, "defs": Array [ Object { "name": Object { - "name": "selector", + "name": "Point", "range": Array [ - 48, - 64, + 62, + 67, ], "type": "Identifier", }, "node": Object { "range": Array [ - 32, - 82, + 56, + 135, ], - "type": "TSDeclareFunction", + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Point", + "range": Array [ + 62, + 67, + ], + "type": "Identifier", + }, + ], + "name": "Point", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + Object { + "$id": 13, + "block": Object { + "range": Array [ + 156, + 229, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [ + Object { + "$id": 12, + "block": Object { + "range": Array [ + 173, + 223, + ], + "type": "TSInterfaceDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "interface", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "block", + "typeMap": Object { + "Id": Object { + "$ref": 11, + }, + }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 15, + }, + "variables": Array [ + Object { + "$id": 11, + "defs": Array [ + Object { + "name": Object { + "name": "Id", + "range": Array [ + 183, + 185, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 173, + 223, + ], + "type": "TSInterfaceDeclaration", }, "parent": null, - "type": "Parameter", + "type": "InterfaceName", }, ], - "eslintUsed": true, + "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "selector", + "name": "Id", "range": Array [ - 48, - 64, + 183, + 185, ], "type": "Identifier", }, ], - "name": "selector", + "name": "Id", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 13, }, }, ], @@ -33688,59 +45552,133 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 31, + 44, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "block", + "typeMap": Object {}, "upperScope": Object { - "$ref": 5, + "$ref": 15, }, "variableMap": Object { - "select": Object { - "$ref": 1, + "B": Object { + "$ref": 3, + }, + "Point": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 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, + }, }, - }, - "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, }, }, ], @@ -33751,16 +45689,20 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 6, + "$ref": 16, }, "variableMap": Object { - "d3": Object { + "A": Object { "$ref": 0, }, + "x": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 5, + "$ref": 15, }, "variables": Array [ Object { @@ -33768,17 +45710,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 +45731,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, }, }, ], @@ -33811,32 +45803,33 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 16, }, "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/global-module-declaration.src 1`] = ` +exports[`typescript fixtures/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = ` Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, - 92, + 33, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 0, "block": Object { "range": Array [ 0, - 92, + 33, ], "type": "Program", }, @@ -33846,60 +45839,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { "$ref": 1, }, - "variables": Array [], - }, - Object { - "$id": 2, - "block": Object { - "range": Array [ - 43, - 51, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], - }, - Object { - "$id": 3, - "block": Object { - "range": Array [ - 81, - 89, - ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 0, }, "variables": Array [], }, @@ -33909,385 +45855,225 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, - "variableMap": Object { - "global": Object { - "$ref": 0, - }, - }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 21, - 51, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - Object { - "name": Object { - "name": "global", - "range": Array [ - 74, - 80, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 56, - 89, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", - }, - Object { - "name": "global", - "range": Array [ - 74, - 80, - ], - "type": "Identifier", - }, - ], - "name": "global", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], + "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` +exports[`typescript fixtures/types/array-type.src 1`] = ` Object { - "$id": 10, + "$id": 3, "block": Object { "range": Array [ 0, - 114, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 2, "block": Object { "range": Array [ 0, - 114, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 1, "block": Object { "range": Array [ - 13, - 112, + 0, + 19, ], - "type": "TSModuleBlock", + "type": "TSTypeAliasDeclaration", }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 34, - 73, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 58, - 66, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 73, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 93, - 110, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "block", + "type": "type-alias", + "typeMap": Object {}, "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, - "bar": Object { - "$ref": 1, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 2, }, - "variables": Array [ + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 34, - 73, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 8, + "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 { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 93, - 110, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", - }, + "name": "Foo", + "range": Array [ + 5, + 8, ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 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/types/conditional.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 10, + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 1, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -34295,395 +46081,190 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` +exports[`typescript fixtures/types/conditional-infer.src 1`] = ` Object { - "$id": 14, + "$id": 8, "block": Object { "range": Array [ 0, - 231, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 13, + "$id": 7, "block": Object { "range": Array [ 0, - 231, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 12, + "$id": 6, "block": Object { "range": Array [ - 9, - 231, + 0, + 48, ], - "type": "TSModuleBlock", + "type": "TSTypeAliasDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 10, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", "range": Array [ - 56, - 135, + 18, + 19, ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 89, - 129, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - "x": Object { - "$ref": 7, - }, - "y": Object { - "$ref": 8, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 7, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 97, - 106, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 89, - 129, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 97, - 106, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "y", - "range": Array [ - 115, - 124, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 89, - 129, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 115, - 124, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object { - "Point": Object { - "$ref": 5, - }, + "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": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", "range": Array [ - 156, - 229, + 35, + 36, ], - "type": "TSModuleBlock", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "block", - "upperScope": Object { - "$ref": 12, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 13, + "type": "Identifier", }, - "variables": Array [], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { "$id": 4, "from": Object { - "$ref": 12, + "$ref": 6, }, "identifier": Object { - "name": "x", + "name": "U", "range": Array [ - 27, - 28, + 42, + 43, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 1, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, }, - "writeExpr": Object { + "identifier": Object { + "name": "T", "range": Array [ - 31, - 44, + 46, + 47, ], - "type": "Literal", + "type": "Identifier", }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, }, ], "throughReferences": Array [ + Object { + "$ref": 3, + }, Object { "$ref": 4, }, ], - "type": "block", - "upperScope": Object { - "$ref": 13, - }, - "variableMap": Object { - "B": Object { - "$ref": 3, - }, - "Point": Object { - "$ref": 2, + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, }, }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 7, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "Point", + "name": "T", "range": Array [ - 62, - 67, + 13, + 14, ], "type": "Identifier", }, "node": Object { "range": Array [ - 56, - 135, + 12, + 15, ], - "type": "ClassDeclaration", + "type": "TSTypeParameterDeclaration", }, "parent": null, - "type": "ClassName", + "type": "TypeParameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Point", + "name": "T", "range": Array [ - 62, - 67, + 13, + 14, ], "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, }, ], - "name": "B", - "references": Array [], "scope": Object { - "$ref": 12, + "$ref": 6, }, }, ], @@ -34692,21 +46273,26 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "type": "module", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "A": Object { + "typeMap": Object { + "Element": Object { "$ref": 0, }, - "x": Object { - "$ref": 1, - }, }, + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 13, + "$ref": 7, }, "variables": Array [ Object { @@ -34714,89 +46300,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "Element", "range": Array [ - 7, - 8, + 5, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 231, + 48, ], - "type": "TSModuleDeclaration", + "type": "TSTypeAliasDeclaration", }, "parent": null, - "type": "NamespaceName", + "type": "TypeAliasName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "Element", "range": Array [ - 7, - 8, + 5, + 12, ], "type": "Identifier", }, ], - "name": "A", + "name": "Element", "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": 7, }, }, ], @@ -34805,153 +46341,386 @@ 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, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/types/conditional.src 1`] = ` +exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` Object { - "$id": 2, + "$id": 15, "block": Object { "range": Array [ 0, - 49, + 127, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 14, "block": Object { "range": Array [ 0, - 49, + 127, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 13, + "block": Object { + "range": Array [ + 0, + 126, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 83, + 84, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 13, + }, + "identifier": Object { + "name": "Promise", + "range": Array [ + 93, + 100, + ], + "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": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 12, + }, + ], + "scope": Object { + "$ref": 13, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "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": 2, - }, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "Unpacked": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 14, }, "variables": Array [ Object { @@ -34959,45 +46728,39 @@ 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, + 126, ], - "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, }, }, ], @@ -35006,112 +46769,35 @@ 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, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 15, }, "variables": Array [], } @@ -35119,7 +46805,7 @@ Object { exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, @@ -35129,7 +46815,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 7, "block": Object { "range": Array [ 0, @@ -35137,31 +46823,254 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 63, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "U", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 8, + 11, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 8, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 7, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 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, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } @@ -35193,6 +47102,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -35259,6 +47169,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -35270,7 +47181,7 @@ Object { exports[`typescript fixtures/types/constructor.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -35280,7 +47191,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35291,11 +47202,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "f": Object { @@ -35303,7 +47257,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -35349,54 +47303,127 @@ Object { "name": "f", "references": Array [], "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/constructor-generic.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 27, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { "$ref": 1, }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/constructor-generic.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 27, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], "type": "module", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { "f": Object { @@ -35404,7 +47431,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -35450,7 +47477,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 +47533,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } @@ -35472,7 +47551,7 @@ Object { exports[`typescript fixtures/types/constructor-in-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35482,7 +47561,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35493,11 +47572,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -35505,7 +47607,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -35551,7 +47653,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -35560,12 +47662,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -35573,7 +47680,7 @@ Object { exports[`typescript fixtures/types/constructor-with-rest.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35583,7 +47690,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35594,11 +47701,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -35606,7 +47736,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -35652,7 +47782,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -35661,12 +47791,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -35674,7 +47809,7 @@ Object { exports[`typescript fixtures/types/function.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -35684,7 +47819,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35695,11 +47830,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 8, + 17, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "f": Object { @@ -35707,7 +47885,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -35753,7 +47931,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -35762,12 +47940,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -35775,7 +47961,7 @@ Object { exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, @@ -35785,7 +47971,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, @@ -35796,11 +47982,76 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 11, + 15, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, "upperScope": Object { - "$ref": 2, + "$ref": 6, }, "variableMap": Object { "f": Object { @@ -35808,7 +48059,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [ Object { @@ -35854,7 +48105,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 +48161,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } @@ -35876,7 +48179,7 @@ Object { exports[`typescript fixtures/types/function-in-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35886,7 +48189,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -35897,11 +48200,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -35909,7 +48235,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -35955,7 +48281,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -35964,12 +48290,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -35977,7 +48308,7 @@ Object { exports[`typescript fixtures/types/function-with-array-destruction.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -35987,7 +48318,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -35995,31 +48326,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -36027,7 +48461,7 @@ Object { exports[`typescript fixtures/types/function-with-object-destruction.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36037,7 +48471,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36045,31 +48479,134 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } @@ -36077,7 +48614,7 @@ Object { exports[`typescript fixtures/types/function-with-rest.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36087,7 +48624,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36098,11 +48635,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -36110,7 +48670,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -36156,7 +48716,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -36165,12 +48725,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36178,7 +48743,7 @@ Object { exports[`typescript fixtures/types/function-with-this.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36188,7 +48753,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36199,11 +48764,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "this", + "range": Array [ + 8, + 20, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "f": Object { @@ -36211,7 +48799,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -36257,7 +48845,7 @@ Object { "name": "f", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -36266,12 +48854,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36279,7 +48872,7 @@ Object { exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36289,7 +48882,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36297,20 +48890,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -36318,10 +48983,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -36329,7 +48995,7 @@ Object { exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36339,7 +49005,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36347,20 +49013,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -36368,10 +49106,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -36379,7 +49118,7 @@ Object { exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36389,7 +49128,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36397,20 +49136,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 29, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -36418,10 +49229,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -36429,7 +49241,7 @@ Object { exports[`typescript fixtures/types/indexed.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -36439,7 +49251,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36450,11 +49262,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "K", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -36462,7 +49317,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -36508,7 +49363,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -36517,12 +49372,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -36530,7 +49393,7 @@ Object { exports[`typescript fixtures/types/intersection-type.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, @@ -36540,7 +49403,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, @@ -36548,20 +49411,210 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "LinkedList", + "range": Array [ + 33, + 43, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "type-alias", + "typeMap": Object { + "T": Object { + "$ref": 1, + }, + }, + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + "parent": null, + "type": "TypeParameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + ], + "name": "T", + "references": Array [ + Object { + "$ref": 2, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "LinkedList": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 7, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + ], + "name": "LinkedList", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -36569,10 +49622,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } @@ -36604,6 +49658,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36670,6 +49725,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36705,6 +49761,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36771,6 +49828,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36806,6 +49864,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -36872,6 +49931,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -36883,7 +49943,7 @@ Object { exports[`typescript fixtures/types/mapped.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36893,7 +49953,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -36904,11 +49964,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -36916,7 +49999,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -36962,7 +50045,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -36971,12 +50054,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -36984,7 +50072,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -36994,7 +50082,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37005,11 +50093,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -37017,7 +50128,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37063,7 +50174,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37072,12 +50183,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37085,7 +50201,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly-minus.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37095,7 +50211,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37106,11 +50222,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -37118,7 +50257,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37164,7 +50303,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37173,12 +50312,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37186,7 +50330,7 @@ Object { exports[`typescript fixtures/types/mapped-readonly-plus.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37196,7 +50340,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37207,11 +50351,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "map": Object { @@ -37219,7 +50386,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37265,7 +50432,7 @@ Object { "name": "map", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37274,12 +50441,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37287,7 +50459,7 @@ Object { exports[`typescript fixtures/types/nested-types.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37297,7 +50469,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37305,20 +50477,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -37326,10 +50570,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -37337,7 +50582,7 @@ Object { exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37347,7 +50592,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37355,20 +50600,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -37376,10 +50693,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -37387,7 +50705,7 @@ Object { exports[`typescript fixtures/types/reference.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37397,7 +50715,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37408,11 +50726,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -37420,7 +50761,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37466,7 +50807,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37475,12 +50816,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37488,7 +50834,7 @@ Object { exports[`typescript fixtures/types/reference-generic.src 1`] = ` Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37498,7 +50844,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -37509,11 +50855,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 3, }, "variableMap": Object { "x": Object { @@ -37521,7 +50890,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -37567,7 +50936,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 2, }, }, ], @@ -37576,12 +50945,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [], } @@ -37589,7 +50963,7 @@ Object { exports[`typescript fixtures/types/reference-generic-nested.src 1`] = ` Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, @@ -37599,7 +50973,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -37610,11 +50984,54 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 13, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 2, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -37622,7 +51039,7 @@ Object { }, }, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [ Object { @@ -37668,7 +51085,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 3, }, }, ], @@ -37677,12 +51094,20 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [], } @@ -37734,6 +51159,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { "$ref": 4, }, @@ -37765,6 +51191,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -37825,6 +51252,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 6, }, @@ -37885,6 +51313,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -37896,7 +51325,7 @@ Object { exports[`typescript fixtures/types/this-type-expanded.src 1`] = ` Object { - "$id": 24, + "$id": 28, "block": Object { "range": Array [ 0, @@ -37906,7 +51335,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 23, + "$id": 27, "block": Object { "range": Array [ 0, @@ -37916,7 +51345,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 22, + "$id": 26, "block": Object { "range": Array [ 0, @@ -37940,8 +51369,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { @@ -37966,7 +51396,7 @@ Object { ], }, Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 109, @@ -37977,11 +51407,36 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 116, + 117, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { @@ -37989,7 +51444,7 @@ Object { }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -38000,13 +51455,13 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], }, Object { - "$id": 11, + "$id": 12, "block": Object { "range": Array [ 167, @@ -38016,7 +51471,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 203, @@ -38030,12 +51485,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 11, + "$ref": 12, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], }, @@ -38044,9 +51500,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "fn", @@ -38058,7 +51514,7 @@ Object { }, "kind": "w", "resolved": Object { - "$ref": 7, + "$ref": 8, }, "writeExpr": Object { "range": Array [ @@ -38069,9 +51525,9 @@ Object { }, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 11, + "$ref": 12, }, "identifier": Object { "name": "fn", @@ -38083,41 +51539,42 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 7, + "$ref": 8, }, "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { - "$ref": 6, + "$ref": 7, }, "fn": Object { - "$ref": 7, + "$ref": 8, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 12, }, "variables": Array [ Object { - "$id": 6, + "$id": 7, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 12, }, }, Object { - "$id": 7, + "$id": 8, "defs": Array [ Object { "name": Object { @@ -38159,20 +51616,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 +51639,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 16, + "$id": 18, "block": Object { "range": Array [ 288, @@ -38196,12 +51653,13 @@ Object { "references": Array [], "throughReferences": Array [], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 17, + "$ref": 19, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 16, + "$ref": 18, }, "variables": Array [], }, @@ -38210,9 +51668,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 +51701,7 @@ Object { }, "kind": "w", "resolved": Object { - "$ref": 13, + "$ref": 14, }, "writeExpr": Object { "range": Array [ @@ -38235,9 +51712,9 @@ Object { }, }, Object { - "$id": 15, + "$id": 17, "from": Object { - "$ref": 17, + "$ref": 19, }, "identifier": Object { "name": "fn", @@ -38249,41 +51726,46 @@ Object { }, "kind": "r", "resolved": Object { - "$ref": 13, + "$ref": 14, }, "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 15, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { - "$ref": 12, + "$ref": 13, }, "fn": Object { - "$ref": 13, + "$ref": 14, }, }, "variableScope": Object { - "$ref": 17, + "$ref": 19, }, "variables": Array [ Object { - "$id": 12, + "$id": 13, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 17, + "$ref": 19, }, }, Object { - "$id": 13, + "$id": 14, "defs": Array [ Object { "name": Object { @@ -38325,20 +51807,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 +51831,61 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 21, + "from": Object { + "$ref": 22, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 352, + 353, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 21, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { - "$ref": 18, + "$ref": 20, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 22, }, "variables": Array [ Object { - "$id": 18, + "$id": 20, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 22, }, }, ], }, Object { - "$id": 21, + "$id": 25, "block": Object { "range": Array [ 404, @@ -38389,30 +51896,55 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 24, + "from": Object { + "$ref": 25, + }, + "identifier": Object { + "name": "A", + "range": Array [ + 411, + 412, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 24, + }, + ], "type": "function", + "typeMap": Object {}, "upperScope": Object { - "$ref": 22, + "$ref": 26, }, "variableMap": Object { "arguments": Object { - "$ref": 20, + "$ref": 23, }, }, "variableScope": Object { - "$ref": 21, + "$ref": 25, }, "variables": Array [ Object { - "$id": 20, + "$id": 23, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 21, + "$ref": 25, }, }, ], @@ -38423,8 +51955,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "class", + "typeMap": Object {}, "upperScope": Object { - "$ref": 23, + "$ref": 27, }, "variableMap": Object { "A": Object { @@ -38432,7 +51965,7 @@ Object { }, }, "variableScope": Object { - "$ref": 23, + "$ref": 27, }, "variables": Array [ Object { @@ -38470,9 +52003,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, }, }, ], @@ -38483,8 +52029,9 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 24, + "$ref": 28, }, "variableMap": Object { "A": Object { @@ -38492,7 +52039,7 @@ Object { }, }, "variableScope": Object { - "$ref": 23, + "$ref": 27, }, "variables": Array [ Object { @@ -38532,7 +52079,7 @@ Object { "name": "A", "references": Array [], "scope": Object { - "$ref": 23, + "$ref": 27, }, }, ], @@ -38543,10 +52090,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 24, + "$ref": 28, }, "variables": Array [], } @@ -38578,6 +52126,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38644,6 +52193,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38679,6 +52229,110 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 10, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 9, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "typeMap": Object {}, + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/types/tuple-optional.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 45, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38699,21 +52353,21 @@ Object { "name": "x", "range": Array [ 4, - 9, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ 4, - 9, + 44, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ 0, - 10, + 44, ], "type": "VariableDeclaration", }, @@ -38726,7 +52380,7 @@ Object { "name": "x", "range": Array [ 4, - 9, + 44, ], "type": "Identifier", }, @@ -38745,6 +52399,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38754,13 +52409,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 +52425,7 @@ Object { "block": Object { "range": Array [ 0, - 45, + 29, ], "type": "Program", }, @@ -38780,6 +52435,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -38800,21 +52456,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 +52483,7 @@ Object { "name": "x", "range": Array [ 4, - 44, + 28, ], "type": "Identifier", }, @@ -38846,6 +52502,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -38855,9 +52512,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 +52524,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, @@ -38875,22 +52532,49 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "x": Object { + "typeMap": Object { + "Foo": Object { "$ref": 0, }, }, + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [ Object { @@ -38898,45 +52582,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, }, }, ], @@ -38947,60 +52625,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/types/tuple-type.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } @@ -39032,6 +52661,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 2, }, @@ -39098,6 +52728,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39109,7 +52740,7 @@ Object { exports[`typescript fixtures/types/type-operator.src 1`] = ` Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, @@ -39119,7 +52750,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39130,11 +52761,34 @@ Object { "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", + "typeMap": Object {}, "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "x": Object { @@ -39145,7 +52799,7 @@ Object { }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { @@ -39191,7 +52845,7 @@ Object { "name": "x", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, Object { @@ -39237,7 +52891,7 @@ Object { "name": "y", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -39246,12 +52900,17 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [], } @@ -39305,6 +52964,7 @@ Object { }, ], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 3, }, @@ -39375,6 +53035,7 @@ Object { }, ], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39410,6 +53071,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object {}, "upperScope": Object { "$ref": 5, }, @@ -39623,6 +53285,7 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { @@ -39634,7 +53297,7 @@ Object { exports[`typescript fixtures/types/union-type.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, @@ -39644,7 +53307,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, @@ -39652,20 +53315,92 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "type-alias", + "typeMap": Object {}, + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", + "typeMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "upperScope": Object { - "$ref": 1, + "$ref": 3, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 26, + ], + "type": "TSTypeAliasDeclaration", + }, + "parent": null, + "type": "TypeAliasName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -39673,10 +53408,11 @@ Object { "references": Array [], "throughReferences": Array [], "type": "global", + "typeMap": Object {}, "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts index dfcb06188754..b76a3026d07e 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,31 @@ 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 +81,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 +108,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) => @@ -118,11 +131,18 @@ export function scopeToJSON(scope: any, resolver = new ReferenceResolver()) { }, {} ); + 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); - 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, { @@ -133,6 +153,7 @@ export function scopeToJSON(scope: any, resolver = new ReferenceResolver()) { variables, references, variableMap, + typeMap, throughReferences, variableScope, upperScope, @@ -145,7 +166,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 2e8c4a40084f..c937a41db43f 100644 --- a/packages/parser/typings/eslint-scope.d.ts +++ b/packages/parser/typings/eslint-scope.d.ts @@ -41,6 +41,9 @@ declare module 'eslint-scope/lib/variable' { references: Reference[]; defs: Definition[]; eslintUsed?: boolean; + stack?: any; + scope?: any; + tainted?: boolean; } } @@ -49,7 +52,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 +61,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 +93,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; @@ -122,7 +127,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; @@ -130,7 +138,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; @@ -148,7 +156,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, @@ -159,8 +172,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; @@ -193,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'; @@ -211,7 +224,9 @@ declare module 'eslint-scope/lib/scope' { | 'with' | 'TDZ' | 'enum' - | 'empty-function'; + | 'empty-function' + | 'interface' + | 'type-alias'; export class Scope { type: ScopeType; @@ -225,7 +240,9 @@ declare module 'eslint-scope/lib/scope' { references: Reference[]; through: Reference[]; thisFound?: boolean; + taints: Map; functionExpressionScope: boolean; + __left: Reference[]; constructor( scopeManager: ScopeManager, @@ -241,15 +258,15 @@ 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( - name: any, - set: any, - variables: any, - node: any, + name: string, + set: Map, + variables: Variable[], + node: TSESTree.Identifier, def: Definition ): void; @@ -257,11 +274,11 @@ declare module 'eslint-scope/lib/scope' { __referencing( node: TSESTree.Node, - assign: number, - writeExpr: TSESTree.Node, - maybeImplicitGlobal: any, - partial: any, - init: any + assign?: ReferenceFlag, + writeExpr?: TSESTree.Node, + maybeImplicitGlobal?: any, + partial?: any, + init?: any ): void; __detectEval(): void; @@ -382,12 +399,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; @@ -416,11 +450,14 @@ declare module 'eslint-scope/lib/scope-manager' { ecmaVersion?: number; } - export default class ScopeManager { - __options: ScopeManagerOptions; - __currentScope: Scope; - scopes: Scope[]; - globalScope: Scope; + export default class ScopeManager { + protected __options: ScopeManagerOptions; + __currentScope: SC; + protected __nodeToScope: WeakMap; + protected __declaredVariables: WeakMap; + + scopes: SC[]; + globalScope: SC; constructor(options: ScopeManagerOptions); @@ -433,28 +470,25 @@ declare module 'eslint-scope/lib/scope-manager' { isStrictModeSupported(): boolean; // Returns appropriate scope for this node. - __get(node: TSESTree.Node): Scope; + __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; - __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; + __nestScope(scope: T): T; + __nestGlobalScope(node: TSESTree.Node): SC; + __nestBlockScope(node: TSESTree.Node): SC; + __nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): SC; + __nestForScope(node: TSESTree.Node): SC; + __nestCatchScope(node: TSESTree.Node): SC; + __nestWithScope(node: TSESTree.Node): SC; + __nestClassScope(node: TSESTree.Node): SC; + __nestSwitchScope(node: TSESTree.Node): SC; + __nestModuleScope(node: TSESTree.Node): SC; + __nestFunctionExpressionNameScope(node: TSESTree.Node): SC; __isES6(): boolean; }