From ebfdb6f012b095da7eb928a06a4b513c19eaf96f Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 24 Oct 2019 09:29:42 -0700 Subject: [PATCH] feat(typescript-estree): add support for declare class properties --- packages/eslint-plugin/src/rules/indent.ts | 1 + .../lib/__snapshots__/typescript.ts.snap | 330 + ...tract-class-with-declare-properties.src.ts | 7 + .../class-with-declare-properties.src.ts | 9 + packages/typescript-estree/src/convert.ts | 1 + .../src/ts-estree/ts-estree.ts | 1 + .../tests/ast-alignment/fixtures-to-test.ts | 17 + .../semantic-diagnostics-enabled.ts.snap | 4 + .../lib/__snapshots__/semanticInfo.ts.snap | 1 + .../lib/__snapshots__/typescript.ts.snap | 8335 +++++++++++------ 10 files changed, 5865 insertions(+), 2841 deletions(-) create mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts create mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 9951db4ea8b0..704bc09dc65b 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -163,6 +163,7 @@ export default util.createRule({ type, static: false, readonly: false, + declare: false, ...base, } as TSESTree.ClassProperty; } diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index ab627ecea750..847709697616 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -932,6 +932,171 @@ Object { } `; +exports[`typescript fixtures/basics/abstract-class-with-declare-properties.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 230, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 230, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 229, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "AbstractDeclProps": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "AbstractDeclProps", + "range": Array [ + 15, + 32, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 229, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AbstractDeclProps", + "range": Array [ + 15, + 32, + ], + "type": "Identifier", + }, + ], + "name": "AbstractDeclProps", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "AbstractDeclProps": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "AbstractDeclProps", + "range": Array [ + 15, + 32, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 229, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AbstractDeclProps", + "range": Array [ + 15, + 32, + ], + "type": "Identifier", + }, + ], + "name": "AbstractDeclProps", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` Object { "$id": 4, @@ -4605,6 +4770,171 @@ Object { } `; +exports[`typescript fixtures/basics/class-with-declare-properties.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 271, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 271, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 270, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "DeclProps": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "DeclProps", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 270, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "DeclProps", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + ], + "name": "DeclProps", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "DeclProps": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "DeclProps", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 270, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "DeclProps", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + ], + "name": "DeclProps", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + exports[`typescript fixtures/basics/class-with-definite-assignment.src 1`] = ` Object { "$id": 4, diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts new file mode 100644 index 000000000000..307d36a66163 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts @@ -0,0 +1,7 @@ +abstract class AbstractDeclProps { + declare prop1: string; + declare abstract prop2: string; + declare public abstract prop3: string; + declare readonly abstract prop4: string; + declare public readonly abstract prop5: string; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts new file mode 100644 index 000000000000..3b37e42e4b19 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts @@ -0,0 +1,9 @@ +class DeclProps { + declare prop1: string; + declare public prop2: string; + declare static prop3: string; + declare readonly prop3: string; + declare public readonly prop4: string; + declare public static prop5: string; + declare public static readonly prop6: string; +} diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 598178158b01..8ffbc03b3ce8 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -926,6 +926,7 @@ export class Converter { computed: isComputedProperty(node.name), static: hasModifier(SyntaxKind.StaticKeyword, node), readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + declare: hasModifier(SyntaxKind.DeclareKeyword, node), }); if (node.type) { diff --git a/packages/typescript-estree/src/ts-estree/ts-estree.ts b/packages/typescript-estree/src/ts-estree/ts-estree.ts index 178ed9efe59d..10cd0b7e0fb2 100644 --- a/packages/typescript-estree/src/ts-estree/ts-estree.ts +++ b/packages/typescript-estree/src/ts-estree/ts-estree.ts @@ -472,6 +472,7 @@ interface ClassPropertyBase extends BaseNode { value: Expression | null; computed: boolean; static: boolean; + declare: boolean; readonly?: boolean; decorators?: Decorator[]; accessibility?: Accessibility; diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 68639cb01b55..4c7276573ff8 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -605,6 +605,20 @@ tester.addFixturePatternConfig('typescript/basics', { 'type-assertion-with-guard-in-function', 'type-assertion-with-guard-in-interface', 'type-assertion-with-guard-in-method', + // declare class properties + 'abstract-class-with-abstract-properties', + 'abstract-class-with-abstract-readonly-property', + 'abstract-class-with-declare-properties', + 'class-with-declare-properties', + 'class-with-definite-assignment', + 'class-with-optional-computed-property', + 'class-with-optional-properties', + 'class-with-optional-property-undefined', + 'class-with-property-function', + 'class-with-property-values', + 'class-with-readonly-property', + 'object-with-escaped-properties', + 'type-reference-comments', ], ignoreSourceType: [ /** @@ -684,6 +698,9 @@ tester.addFixturePatternConfig('typescript/decorators/property-decorators', { // optional chaining 'property-decorator-factory-instance-member', 'property-decorator-factory-static-member', + // declare class properties + 'property-decorator-instance-member', + 'property-decorator-static-member', ], }); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 645b6114f8ac..423d0c5bc652 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1650,6 +1650,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-declare-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-optional-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-interface.src 1`] = ` @@ -1708,6 +1710,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-declare-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src 1`] = ` diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap index c1ba4580efde..f6b67ce5556a 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap @@ -1254,6 +1254,7 @@ Object { "body": Array [ Object { "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 44425c5e4a57..6437b88068c8 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -1607,6 +1607,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -1645,6 +1646,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -2017,6 +2019,7 @@ Object { Object { "accessibility": "public", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -2362,220 +2365,421 @@ Object { } `; -exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` +exports[`typescript fixtures/basics/abstract-class-with-declare-properties.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "abstract": true, - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { + "abstract": true, + "body": Object { + "body": Array [ + Object { + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "prop1", + "range": Array [ + 45, + 50, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 37, + 59, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 50, + 58, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 2, }, "start": Object { - "column": 4, + "column": 17, "line": 2, }, }, - "name": "createSocket", - "optional": true, "range": Array [ - 43, - 55, + 52, + 58, ], - "type": "Identifier", + "type": "TSStringKeyword", }, - "kind": "method", + }, + "value": null, + }, + Object { + "computed": false, + "declare": true, + "key": Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 24, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 19, + "line": 3, }, }, + "name": "prop2", "range": Array [ - 43, - 76, + 79, + 84, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": null, - "expression": false, - "generator": false, - "id": null, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 62, + 93, + ], + "static": false, + "type": "TSAbstractClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 84, + 92, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 32, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 26, + "line": 3, }, }, - "params": Array [], "range": Array [ - 56, - 76, + 86, + 92, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "name": "prop3", + "range": Array [ + 120, + 125, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 96, + 134, + ], + "static": false, + "type": "TSAbstractClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 4, + }, + "start": Object { + "column": 31, + "line": 4, + }, + }, + "range": Array [ + 125, + 133, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 4, }, - "range": Array [ - 58, - 75, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 60, - 75, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "name": "Promise", - "range": Array [ - 60, - 67, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 2, - }, - "start": Object { - "column": 29, - "line": 2, - }, - }, - "range": Array [ - 68, - 74, - ], - "type": "TSStringKeyword", - }, - ], - "range": Array [ - 67, - 75, - ], - "type": "TSTypeParameterInstantiation", - }, + "start": Object { + "column": 33, + "line": 4, }, }, - "type": "FunctionExpression", + "range": Array [ + 127, + 133, + ], + "type": "TSStringKeyword", }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, + "value": null, + }, + Object { + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "name": "prop4", + "range": Array [ + 163, + 168, + ], + "type": "Identifier", }, - "start": Object { - "column": 37, - "line": 1, + "loc": Object { + "end": Object { + "column": 42, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 137, + 177, + ], + "readonly": true, + "static": false, + "type": "TSAbstractClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 5, + }, + "start": Object { + "column": 33, + "line": 5, + }, + }, + "range": Array [ + 168, + 176, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 5, + }, + "start": Object { + "column": 35, + "line": 5, + }, + }, + "range": Array [ + 170, + 176, + ], + "type": "TSStringKeyword", + }, }, + "value": null, }, - "range": Array [ - 37, - 78, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 35, + "line": 6, + }, + }, + "name": "prop5", + "range": Array [ + 213, + 218, + ], + "type": "Identifier", }, - "start": Object { - "column": 22, - "line": 1, + "loc": Object { + "end": Object { + "column": 49, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 180, + 227, + ], + "readonly": true, + "static": false, + "type": "TSAbstractClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 6, + }, + "start": Object { + "column": 40, + "line": 6, + }, + }, + "range": Array [ + 218, + 226, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 6, + }, + "start": Object { + "column": 42, + "line": 6, + }, + }, + "range": Array [ + 220, + 226, + ], + "type": "TSStringKeyword", + }, }, + "value": null, }, - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, + ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 7, }, "start": Object { - "column": 7, + "column": 33, "line": 1, }, }, "range": Array [ - 7, - 78, + 33, + 229, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "AbstractDeclProps", + "range": Array [ + 15, + 32, + ], + "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 7, }, "start": Object { "column": 0, @@ -2584,17 +2788,16 @@ Object { }, "range": Array [ 0, - 78, + 229, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 0, + "line": 8, }, "start": Object { "column": 0, @@ -2603,14 +2806,14 @@ Object { }, "range": Array [ 0, - 78, + 230, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -2620,25 +2823,7 @@ Object { }, "range": Array [ 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 15, + 8, ], "type": "Identifier", "value": "abstract", @@ -2646,17 +2831,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 14, "line": 1, }, "start": Object { - "column": 16, + "column": 9, "line": 1, }, }, "range": Array [ - 16, - 21, + 9, + 14, ], "type": "Keyword", "value": "class", @@ -2664,35 +2849,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 36, + "column": 32, "line": 1, }, "start": Object { - "column": 22, + "column": 15, "line": 1, }, }, "range": Array [ - 22, - 36, + 15, + 32, ], "type": "Identifier", - "value": "AbstractSocket", + "value": "AbstractDeclProps", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 34, "line": 1, }, "start": Object { - "column": 37, + "column": 33, "line": 1, }, }, "range": Array [ - 37, - 38, + 33, + 34, ], "type": "Punctuator", "value": "{", @@ -2700,83 +2885,83 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 9, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 43, - 55, + 37, + 44, ], "type": "Identifier", - "value": "createSocket", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 2, }, "start": Object { - "column": 16, + "column": 10, "line": 2, }, }, "range": Array [ - 55, - 56, + 45, + 50, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "prop1", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 2, }, "start": Object { - "column": 17, + "column": 15, "line": 2, }, }, "range": Array [ - 56, - 57, + 50, + 51, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 23, "line": 2, }, "start": Object { - "column": 18, + "column": 17, "line": 2, }, }, "range": Array [ - 57, + 52, 58, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 24, "line": 2, }, "start": Object { - "column": 19, + "column": 23, "line": 2, }, }, @@ -2785,246 +2970,166 @@ Object { 59, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 21, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 60, - 67, + 62, + 69, ], "type": "Identifier", - "value": "Promise", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 18, + "line": 3, }, "start": Object { - "column": 28, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 67, - 68, + 70, + 78, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 24, + "line": 3, }, "start": Object { - "column": 29, - "line": 2, + "column": 19, + "line": 3, }, }, "range": Array [ - 68, - 74, + 79, + 84, ], "type": "Identifier", - "value": "string", + "value": "prop2", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 2, + "column": 25, + "line": 3, }, "start": Object { - "column": 35, - "line": 2, + "column": 24, + "line": 3, }, }, "range": Array [ - 74, - 75, + 84, + 85, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 32, + "line": 3, }, "start": Object { - "column": 36, - "line": 2, + "column": 26, + "line": 3, }, }, "range": Array [ - 75, - 76, + 86, + 92, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 33, "line": 3, }, "start": Object { - "column": 0, + "column": 32, "line": 3, }, }, "range": Array [ - 77, - 78, + 92, + 93, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "abstract": true, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 31, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "I", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 31, - ], - "type": "TSInterfaceDeclaration", - }, "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 9, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 0, - 31, + 96, + 103, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "declare", }, - }, - "range": Array [ - 0, - 31, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 16, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 4, }, }, "range": Array [ - 0, - 6, + 104, + 110, ], "type": "Keyword", - "value": "export", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 25, + "line": 4, }, "start": Object { - "column": 7, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 7, - 15, + 111, + 119, ], "type": "Identifier", "value": "abstract", @@ -3032,532 +3137,582 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 31, + "line": 4, }, "start": Object { - "column": 16, - "line": 1, + "column": 26, + "line": 4, }, }, "range": Array [ - 16, - 25, + 120, + 125, ], - "type": "Keyword", - "value": "interface", + "type": "Identifier", + "value": "prop3", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 32, + "line": 4, }, "start": Object { - "column": 26, - "line": 1, + "column": 31, + "line": 4, }, }, "range": Array [ - 26, - 27, + 125, + 126, ], - "type": "Identifier", - "value": "I", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 39, + "line": 4, }, "start": Object { - "column": 28, - "line": 1, + "column": 33, + "line": 4, }, }, "range": Array [ - 28, - 29, + 127, + 133, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 40, + "line": 4, }, "start": Object { - "column": 0, - "line": 2, + "column": 39, + "line": 4, }, }, "range": Array [ - 30, - 31, + 133, + 134, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/angle-bracket-type-assertion.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 27, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 27, - ], - "type": "TSTypeAssertion", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 16, - ], - "type": "TSAnyKeyword", - }, - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 0, - 28, + 137, + 144, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "declare", }, - }, - "range": Array [ - 0, - 29, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 18, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 5, }, }, "range": Array [ - 0, - 5, + 145, + 153, ], - "type": "Keyword", - "value": "const", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 27, + "line": 5, }, "start": Object { - "column": 6, - "line": 1, - }, + "column": 19, + "line": 5, + }, }, "range": Array [ - 6, - 9, + 154, + 162, ], "type": "Identifier", - "value": "foo", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 33, + "line": 5, }, "start": Object { - "column": 10, - "line": 1, + "column": 28, + "line": 5, }, }, "range": Array [ - 10, - 11, + 163, + 168, + ], + "type": "Identifier", + "value": "prop4", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 5, + }, + "start": Object { + "column": 33, + "line": 5, + }, + }, + "range": Array [ + 168, + 169, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 41, + "line": 5, }, "start": Object { - "column": 12, - "line": 1, + "column": 35, + "line": 5, }, }, "range": Array [ - 12, - 13, + 170, + 176, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 5, + }, + "start": Object { + "column": 41, + "line": 5, + }, + }, + "range": Array [ + 176, + 177, ], "type": "Punctuator", - "value": "<", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 9, + "line": 6, }, "start": Object { - "column": 13, - "line": 1, + "column": 2, + "line": 6, }, }, "range": Array [ - 13, - 16, + 180, + 187, ], "type": "Identifier", - "value": "any", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "range": Array [ + 188, + 194, + ], + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { + "column": 25, + "line": 6, + }, + "start": Object { "column": 17, - "line": 1, + "line": 6, + }, + }, + "range": Array [ + 195, + 203, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 6, }, "start": Object { - "column": 16, - "line": 1, + "column": 26, + "line": 6, }, }, "range": Array [ - 16, - 17, + 204, + 212, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 35, + "line": 6, + }, + }, + "range": Array [ + 213, + 218, + ], + "type": "Identifier", + "value": "prop5", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 6, + }, + "start": Object { + "column": 40, + "line": 6, + }, + }, + "range": Array [ + 218, + 219, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 48, + "line": 6, }, "start": Object { - "column": 26, - "line": 1, + "column": 42, + "line": 6, }, }, "range": Array [ - 26, - 27, + 220, + 226, ], - "type": "Numeric", - "value": "2", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 49, + "line": 6, }, "start": Object { - "column": 27, - "line": 1, + "column": 48, + "line": 6, }, }, "range": Array [ - 27, - 28, + 226, + 227, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 228, + 229, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/angle-bracket-type-assertion-arrow-function.src 1`] = ` +exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "asserted2", - "range": Array [ - 4, - 13, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "name": "n", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 40, - ], - "type": "ReturnStatement", - }, - ], + "declaration": Object { + "abstract": true, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 4, + "line": 2, }, }, + "name": "createSocket", + "optional": true, "range": Array [ - 29, - 42, + 43, + 55, ], - "type": "BlockStatement", + "type": "Identifier", }, - "expression": false, - "generator": false, - "id": null, + "kind": "method", "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 37, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 2, }, }, - "params": Array [ - Object { + "range": Array [ + 43, + 76, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 56, + 76, + ], + "returnType": Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 36, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 19, + "line": 2, }, }, - "name": "n", "range": Array [ - 23, - 24, + 58, + 75, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 60, + 75, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "Promise", + "range": Array [ + 60, + 67, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 67, + 75, + ], + "type": "TSTypeParameterInstantiation", + }, + }, }, - ], - "range": Array [ - 22, - 42, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, + "type": "FunctionExpression", }, }, - "range": Array [ - 16, - 43, - ], - "type": "TSTypeAssertion", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 20, - ], - "type": "TSAnyKeyword", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 1, }, }, + "range": Array [ + 37, + 78, + ], + "type": "ClassBody", + }, + "id": Object { "loc": Object { "end": Object { - "column": 43, + "column": 36, "line": 1, }, "start": Object { - "column": 4, + "column": 22, "line": 1, }, }, + "name": "AbstractSocket", "range": Array [ - 4, - 43, + 22, + 36, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - ], - "kind": "var", + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 78, + ], + "superClass": null, + "type": "ClassDeclaration", + }, "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -3566,15 +3721,17 @@ Object { }, "range": Array [ 0, - 44, + 78, ], - "type": "VariableDeclaration", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -3583,14 +3740,14 @@ Object { }, "range": Array [ 0, - 45, + 78, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { @@ -3600,28 +3757,10 @@ Object { }, "range": Array [ 0, - 3, + 6, ], "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 13, - ], - "type": "Identifier", - "value": "asserted2", + "value": "export", }, Object { "loc": Object { @@ -3630,21 +3769,21 @@ Object { "line": 1, }, "start": Object { - "column": 14, + "column": 7, "line": 1, }, }, "range": Array [ - 14, + 7, 15, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { @@ -3654,115 +3793,115 @@ Object { }, "range": Array [ 16, - 17, + 21, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 36, "line": 1, }, "start": Object { - "column": 17, + "column": 22, "line": 1, }, }, "range": Array [ - 17, - 20, + 22, + 36, ], "type": "Identifier", - "value": "any", + "value": "AbstractSocket", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 38, "line": 1, }, "start": Object { - "column": 20, + "column": 37, "line": 1, }, }, "range": Array [ - 20, - 21, + 37, + 38, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 21, - 22, + 43, + 55, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "createSocket", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 22, - 23, + 55, + 56, ], "type": "Punctuator", - "value": "(", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 23, - 24, + 56, + 57, ], - "type": "Identifier", - "value": "n", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 24, - 25, + 57, + 58, ], "type": "Punctuator", "value": ")", @@ -3770,276 +3909,196 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 26, - 28, + 58, + 59, ], "type": "Punctuator", - "value": "=>", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 29, - 30, + 60, + 67, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Promise", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 29, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 28, + "line": 2, }, }, "range": Array [ - 31, - 37, + 67, + 68, ], - "type": "Keyword", - "value": "return", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 35, + "line": 2, }, "start": Object { - "column": 38, - "line": 1, + "column": 29, + "line": 2, }, }, "range": Array [ - 38, - 39, + 68, + 74, ], "type": "Identifier", - "value": "n", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": ";", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 36, + "line": 2, }, "start": Object { - "column": 41, - "line": 1, + "column": 35, + "line": 2, }, }, "range": Array [ - 41, - 42, + 74, + 75, ], "type": "Punctuator", - "value": "}", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 37, + "line": 2, }, "start": Object { - "column": 42, - "line": 1, + "column": 36, + "line": 2, }, }, "range": Array [ - 42, - 43, + 75, + 76, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 43, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 43, - 44, + 77, + 78, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/arrow-function-with-optional-parameter.src 1`] = ` +exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "async": false, - "body": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "k", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "declaration": Object { + "abstract": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, }, - "operator": "+", - "range": Array [ - 9, - 14, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "raw": "1", - "type": "Literal", - "value": 1, + "start": Object { + "column": 28, + "line": 1, }, - "type": "BinaryExpression", }, - "expression": true, - "generator": false, - "id": null, + "range": Array [ + 28, + 31, + ], + "type": "TSInterfaceBody", + }, + "id": Object { "loc": Object { "end": Object { - "column": 14, + "column": 27, "line": 1, }, "start": Object { - "column": 1, + "column": 26, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "name": "k", - "optional": true, - "range": Array [ - 2, - 4, - ], - "type": "Identifier", - }, - ], + "name": "I", "range": Array [ - 1, - 14, + 26, + 27, ], - "type": "ArrowFunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, - "optional": false, "range": Array [ - 0, - 17, + 7, + 31, ], - "type": "CallExpression", + "type": "TSInterfaceDeclaration", }, "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { "column": 0, @@ -4048,14 +4107,16 @@ Object { }, "range": Array [ 0, - 18, + 31, ], - "type": "ExpressionStatement", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, + "column": 1, "line": 2, }, "start": Object { @@ -4065,14 +4126,14 @@ Object { }, "range": Array [ 0, - 19, + 31, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 6, "line": 1, }, "start": Object { @@ -4082,172 +4143,305 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, + 6, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 15, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, "range": Array [ - 2, - 3, + 7, + 15, ], "type": "Identifier", - "value": "k", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 25, "line": 1, }, "start": Object { - "column": 3, + "column": 16, "line": 1, }, }, "range": Array [ - 3, - 4, + 16, + 25, ], - "type": "Punctuator", - "value": "?", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 27, "line": 1, }, "start": Object { - "column": 4, + "column": 26, "line": 1, }, }, "range": Array [ - 4, - 5, + 26, + 27, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "I", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 29, "line": 1, }, "start": Object { - "column": 6, + "column": 28, "line": 1, }, }, "range": Array [ - 6, - 8, + 28, + 29, ], "type": "Punctuator", - "value": "=>", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "k", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 11, - 12, + 30, + 31, ], "type": "Punctuator", - "value": "+", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/angle-bracket-type-assertion.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 27, + ], + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "TSAnyKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, }, "range": Array [ - 13, - 14, + 0, + 28, ], - "type": "Numeric", - "value": "1", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 15, + "column": 5, "line": 1, }, "start": Object { - "column": 14, + "column": 0, "line": 1, }, }, "range": Array [ - 14, - 15, + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, ], "type": "Punctuator", - "value": ")", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { @@ -4256,16 +4450,16 @@ Object { "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, + 13, 16, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { @@ -4283,22 +4477,40 @@ Object { 17, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 27, "line": 1, }, "start": Object { - "column": 17, + "column": 26, "line": 1, }, }, "range": Array [ - 17, - 18, + 26, + 27, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -4308,84 +4520,16 @@ Object { } `; -exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/angle-bracket-type-assertion-arrow-function.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "b", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 22, - 31, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 33, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 1, }, "start": Object { @@ -4393,182 +4537,164 @@ Object { "line": 1, }, }, - "name": "b", + "name": "asserted2", "range": Array [ 4, - 8, + 13, ], "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 8, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + }, + "init": Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "name": "n", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 40, + ], + "type": "ReturnStatement", + }, + ], "loc": Object { "end": Object { - "column": 8, + "column": 42, "line": 1, }, "start": Object { - "column": 7, + "column": 29, "line": 1, }, }, "range": Array [ - 7, - 8, + 29, + 42, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 8, + "column": 24, "line": 1, }, "start": Object { - "column": 7, + "column": 23, "line": 1, }, }, - "name": "X", + "name": "n", "range": Array [ - 7, - 8, + 23, + 24, ], "type": "Identifier", }, - }, - }, - }, - ], - "range": Array [ - 0, - 33, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + ], + "range": Array [ + 22, + 42, + ], + "type": "ArrowFunctionExpression", }, - }, - "range": Array [ - 9, - 12, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 12, + "column": 43, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, "range": Array [ - 11, - 12, + 16, + 43, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAssertion", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 12, + "column": 20, "line": 1, }, "start": Object { - "column": 11, + "column": 17, "line": 1, }, }, - "name": "X", "range": Array [ - 11, - 12, + 17, + 20, ], - "type": "Identifier", + "type": "TSAnyKeyword", }, }, - }, - "type": "ArrowFunctionExpression", - "typeParameters": Object { "loc": Object { "end": Object { - "column": 3, + "column": 43, "line": 1, }, "start": Object { - "column": 0, + "column": 4, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "range": Array [ - 1, - 2, - ], - "type": "TSTypeParameter", - }, - ], "range": Array [ - 0, - 3, + 4, + 43, ], - "type": "TSTypeParameterDeclaration", + "type": "VariableDeclarator", }, - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 44, + "line": 1, }, "start": Object { "column": 0, @@ -4577,15 +4703,15 @@ Object { }, "range": Array [ 0, - 33, + 44, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -4594,14 +4720,14 @@ Object { }, "range": Array [ 0, - 33, + 45, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -4611,187 +4737,187 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 13, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, "range": Array [ - 1, - 2, + 4, + 13, ], "type": "Identifier", - "value": "X", + "value": "asserted2", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 15, "line": 1, }, "start": Object { - "column": 2, + "column": 14, "line": 1, }, }, "range": Array [ - 2, - 3, + 14, + 15, ], "type": "Punctuator", - "value": ">", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 17, "line": 1, }, "start": Object { - "column": 3, + "column": 16, "line": 1, }, }, "range": Array [ - 3, - 4, + 16, + 17, ], "type": "Punctuator", - "value": "(", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 20, "line": 1, }, "start": Object { - "column": 4, + "column": 17, "line": 1, }, }, "range": Array [ - 4, - 5, + 17, + 20, ], "type": "Identifier", - "value": "b", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 21, "line": 1, }, "start": Object { - "column": 5, + "column": 20, "line": 1, }, }, "range": Array [ - 5, - 6, + 20, + 21, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 22, "line": 1, }, "start": Object { - "column": 7, + "column": 21, "line": 1, }, }, "range": Array [ - 7, - 8, + 21, + 22, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 23, "line": 1, }, "start": Object { - "column": 8, + "column": 22, "line": 1, }, }, "range": Array [ - 8, - 9, + 22, + 23, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 24, "line": 1, }, "start": Object { - "column": 9, + "column": 23, "line": 1, }, }, "range": Array [ - 9, - 10, + 23, + 24, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "n", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 25, "line": 1, }, "start": Object { - "column": 11, + "column": 24, "line": 1, }, }, "range": Array [ - 11, - 12, + 24, + 25, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 28, "line": 1, }, "start": Object { - "column": 13, + "column": 26, "line": 1, }, }, "range": Array [ - 13, - 15, + 26, + 28, ], "type": "Punctuator", "value": "=>", @@ -4799,17 +4925,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 30, "line": 1, }, "start": Object { - "column": 16, + "column": 29, "line": 1, }, }, "range": Array [ - 16, - 17, + 29, + 30, ], "type": "Punctuator", "value": "{", @@ -4817,17 +4943,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 37, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 31, + "line": 1, }, }, "range": Array [ - 22, - 28, + 31, + 37, ], "type": "Keyword", "value": "return", @@ -4835,35 +4961,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 39, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 38, + "line": 1, }, }, "range": Array [ - 29, - 30, + 38, + 39, ], "type": "Identifier", - "value": "b", + "value": "n", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 40, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 39, + "line": 1, }, }, "range": Array [ - 30, - 31, + 39, + 40, ], "type": "Punctuator", "value": ";", @@ -4871,93 +4997,169 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 42, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 41, + "line": 1, }, }, "range": Array [ - 32, - 33, + 41, + 42, ], "type": "Punctuator", "value": "}", }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ";", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/async-function-expression.src 1`] = ` +exports[`typescript fixtures/basics/arrow-function-with-optional-parameter.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "arguments": Array [], "callee": Object { - "async": true, + "async": false, "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 1, + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "name": "k", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, - "range": Array [ - 23, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 20, + "column": 14, "line": 1, }, "start": Object { - "column": 16, + "column": 9, "line": 1, }, }, - "name": "test", + "operator": "+", "range": Array [ - 16, - 20, + 9, + 14, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", }, + "expression": true, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { "column": 1, "line": 1, }, }, - "params": Array [], + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "k", + "optional": true, + "range": Array [ + 2, + 4, + ], + "type": "Identifier", + }, + ], "range": Array [ 1, - 26, + 14, ], - "type": "FunctionExpression", + "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { "column": 0, @@ -4967,14 +5169,14 @@ Object { "optional": false, "range": Array [ 0, - 29, + 17, ], "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { "column": 0, @@ -4983,14 +5185,14 @@ Object { }, "range": Array [ 0, - 30, + 18, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 5, + "column": 0, "line": 2, }, "start": Object { @@ -5000,7 +5202,7 @@ Object { }, "range": Array [ 0, - 30, + 19, ], "sourceType": "script", "tokens": Array [ @@ -5025,7 +5227,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 2, "line": 1, }, "start": Object { @@ -5035,133 +5237,151 @@ Object { }, "range": Array [ 1, - 6, + 2, ], - "type": "Identifier", - "value": "async", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 3, "line": 1, }, "start": Object { - "column": 7, + "column": 2, "line": 1, }, }, "range": Array [ - 7, - 15, + 2, + 3, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "k", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 4, "line": 1, }, "start": Object { - "column": 16, + "column": 3, "line": 1, }, }, "range": Array [ - 16, - 20, + 3, + 4, ], - "type": "Identifier", - "value": "test", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 5, "line": 1, }, "start": Object { - "column": 20, + "column": 4, "line": 1, }, }, "range": Array [ - 20, - 21, + 4, + 5, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 8, "line": 1, }, "start": Object { - "column": 21, + "column": 6, "line": 1, }, }, "range": Array [ - 21, - 22, + 6, + 8, ], "type": "Punctuator", - "value": ")", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 10, "line": 1, }, "start": Object { - "column": 23, + "column": 9, "line": 1, }, }, "range": Array [ - 23, - 24, + 9, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "k", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 25, - 26, + 11, + 12, ], "type": "Punctuator", - "value": "}", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 1, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 26, - 27, + 13, + 14, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, ], "type": "Punctuator", "value": ")", @@ -5169,17 +5389,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 27, - 28, + 15, + 16, ], "type": "Punctuator", "value": "(", @@ -5187,17 +5407,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 3, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 28, - 29, + 16, + 17, ], "type": "Punctuator", "value": ")", @@ -5205,17 +5425,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 29, - 30, + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -5225,34 +5445,951 @@ Object { } `; -exports[`typescript fixtures/basics/async-function-with-var-declaration.src 1`] = ` +exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` Object { "body": Array [ Object { - "async": true, - "body": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, }, - "name": "foo", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 31, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 33, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 33, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + }, + }, + "type": "ArrowFunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "range": Array [ + 1, + 2, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 0, + 3, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/async-function-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "async": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 26, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "optional": false, + "range": Array [ + 0, + 29, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 6, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/async-function-with-var-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, "init": Object { "loc": Object { "end": Object { @@ -9797,6 +10934,7 @@ Object { Object { "accessibility": "private", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -9870,6 +11008,7 @@ Object { Object { "accessibility": "public", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -9941,132 +11080,1269 @@ Object { "value": null, }, Object { - "accessibility": "public", + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "getBar", + "range": Array [ + 75, + 81, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 68, + 111, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 98, + 102, + ], + "type": "ThisExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "name": "bar", + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + }, + "range": Array [ + 98, + 106, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 91, + 107, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 85, + 111, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "params": Array [], + "range": Array [ + 82, + 111, + ], + "type": "FunctionExpression", + }, + }, + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "name": "setBar", + "range": Array [ + 124, + 130, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 114, + 171, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 152, + 156, + ], + "type": "ThisExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "name": "bar", + "range": Array [ + 157, + 160, + ], + "type": "Identifier", + }, + "range": Array [ + 152, + 160, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "operator": "=", + "range": Array [ + 152, + 166, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "name": "bar", + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 152, + 167, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 34, + "line": 7, + }, + }, + "range": Array [ + 146, + 171, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 7, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "name": "bar", + "range": Array [ + 132, + 144, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 24, + "line": 7, + }, + }, + "range": Array [ + 136, + 144, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 26, + "line": 7, + }, + }, + "range": Array [ + 138, + 144, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 131, + 171, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 173, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 173, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 174, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 45, + 51, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 75, + 81, + ], + "type": "Identifier", + "value": "getBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 91, + 97, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 98, + 102, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 114, + 123, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 124, + 130, + ], + "type": "Identifier", + "value": "setBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 19, + "line": 7, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 132, + 135, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 7, + }, + "start": Object { + "column": 24, + "line": 7, + }, + }, + "range": Array [ + 136, + 137, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 26, + "line": 7, + }, + }, + "range": Array [ + 138, + 144, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 7, + }, + "start": Object { + "column": 32, + "line": 7, + }, + }, + "range": Array [ + 144, + 145, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 7, + }, + "start": Object { + "column": 34, + "line": 7, + }, + }, + "range": Array [ + 146, + 147, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 152, + 156, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 156, + 157, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 157, + 160, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "range": Array [ + 161, + 162, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 8, + }, + "start": Object { + "column": 18, + "line": 8, + }, + }, + "range": Array [ + 166, + 167, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 170, + 171, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "range": Array [ + 172, + 173, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-constructor-and-modifier.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "protected", "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 23, + "line": 2, }, "start": Object { - "column": 9, - "line": 4, + "column": 12, + "line": 2, }, }, - "name": "getBar", + "name": "constructor", "range": Array [ - 75, - 81, + 22, + 33, ], "type": "Identifier", }, - "kind": "method", + "kind": "constructor", "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 29, + "line": 2, }, "start": Object { "column": 2, - "line": 4, + "line": 2, }, }, "range": Array [ - 68, - 111, + 12, + 39, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, "body": Object { - "body": Array [ - Object { - "argument": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 5, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 5, - }, - }, - "range": Array [ - 98, - 102, - ], - "type": "ThisExpression", - }, - "optional": false, - "property": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 5, - }, - }, - "name": "bar", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "range": Array [ - 98, - 106, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 91, - 107, - ], - "type": "ReturnStatement", - }, - ], + "body": Array [], "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 29, + "line": 2, }, "start": Object { - "column": 19, - "line": 4, + "column": 26, + "line": 2, }, }, "range": Array [ - 85, - 111, + 36, + 39, ], "type": "BlockStatement", }, @@ -10075,185 +12351,78 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 29, + "line": 2, }, "start": Object { - "column": 16, - "line": 4, + "column": 23, + "line": 2, }, }, "params": Array [], "range": Array [ - 82, - 111, + 33, + 39, ], "type": "FunctionExpression", }, }, Object { - "accessibility": "protected", - "computed": false, + "accessibility": "public", + "computed": true, "key": Object { "loc": Object { "end": Object { - "column": 18, - "line": 7, + "column": 23, + "line": 4, }, "start": Object { - "column": 12, - "line": 7, + "column": 10, + "line": 4, }, }, - "name": "setBar", "range": Array [ - 124, - 130, + 51, + 64, ], - "type": "Identifier", + "raw": "'constructor'", + "type": "Literal", + "value": "constructor", }, "kind": "method", "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 30, + "line": 4, }, "start": Object { "column": 2, - "line": 7, + "line": 4, }, }, "range": Array [ - 114, - 171, + 43, + 71, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, "body": Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 12, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 152, - 156, - ], - "type": "ThisExpression", - }, - "optional": false, - "property": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 8, - }, - "start": Object { - "column": 9, - "line": 8, - }, - }, - "name": "bar", - "range": Array [ - 157, - 160, - ], - "type": "Identifier", - }, - "range": Array [ - 152, - 160, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "operator": "=", - "range": Array [ - 152, - 166, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 8, - }, - "start": Object { - "column": 15, - "line": 8, - }, - }, - "name": "bar", - "range": Array [ - 163, - 166, - ], - "type": "Identifier", - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 152, - 167, - ], - "type": "ExpressionStatement", - }, - ], + "body": Array [], "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 30, + "line": 4, }, "start": Object { - "column": 34, - "line": 7, + "column": 27, + "line": 4, }, }, "range": Array [ - 146, - 171, + 68, + 71, ], "type": "BlockStatement", }, @@ -10262,71 +12431,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 30, + "line": 4, }, "start": Object { - "column": 19, - "line": 7, + "column": 24, + "line": 4, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 7, - }, - "start": Object { - "column": 20, - "line": 7, - }, - }, - "name": "bar", - "range": Array [ - 132, - 144, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 7, - }, - "start": Object { - "column": 24, - "line": 7, - }, - }, - "range": Array [ - 136, - 144, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 7, - }, - "start": Object { - "column": 26, - "line": 7, - }, - }, - "range": Array [ - 138, - 144, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], + "params": Array [], "range": Array [ - 131, - 171, + 65, + 71, ], "type": "FunctionExpression", }, @@ -10335,23 +12451,23 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 10, + "line": 5, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 173, + 8, + 73, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -10359,17 +12475,17 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 10, + "line": 5, }, "start": Object { "column": 0, @@ -10378,7 +12494,7 @@ Object { }, "range": Array [ 0, - 173, + 73, ], "superClass": null, "type": "ClassDeclaration", @@ -10387,7 +12503,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 11, + "line": 6, }, "start": Object { "column": 0, @@ -10396,7 +12512,7 @@ Object { }, "range": Array [ 0, - 174, + 74, ], "sourceType": "script", "tokens": Array [ @@ -10421,7 +12537,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -10431,25 +12547,25 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -10457,7 +12573,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 2, }, "start": Object { @@ -10466,183 +12582,165 @@ Object { }, }, "range": Array [ - 14, + 12, 21, ], "type": "Keyword", - "value": "private", + "value": "protected", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 2, }, "start": Object { - "column": 10, + "column": 12, "line": 2, }, }, "range": Array [ 22, - 25, + 33, ], "type": "Identifier", - "value": "bar", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 24, "line": 2, }, "start": Object { - "column": 14, + "column": 23, "line": 2, }, }, "range": Array [ - 26, - 27, + 33, + 34, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 2, }, "start": Object { - "column": 16, + "column": 24, "line": 2, }, }, "range": Array [ - 28, 34, + 35, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 27, "line": 2, }, "start": Object { - "column": 22, + "column": 26, "line": 2, }, }, "range": Array [ - 34, - 35, + 36, + 37, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 29, + "line": 2, }, "start": Object { - "column": 2, - "line": 3, + "column": 28, + "line": 2, }, }, "range": Array [ 38, - 44, + 39, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 8, + "line": 4, }, "start": Object { - "column": 9, - "line": 3, + "column": 2, + "line": 4, }, }, "range": Array [ - 45, - 51, + 43, + 49, ], "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, - }, - }, - "range": Array [ - 52, - 55, - ], - "type": "Identifier", - "value": "baz", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 10, + "line": 4, }, "start": Object { - "column": 20, - "line": 3, + "column": 9, + "line": 4, }, }, "range": Array [ - 56, - 57, + 50, + 51, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 23, + "line": 4, }, "start": Object { - "column": 22, - "line": 3, + "column": 10, + "line": 4, }, }, "range": Array [ - 58, + 51, 64, ], - "type": "Identifier", - "value": "number", + "type": "String", + "value": "'constructor'", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 24, + "line": 4, }, "start": Object { - "column": 28, - "line": 3, + "column": 23, + "line": 4, }, }, "range": Array [ @@ -10650,472 +12748,741 @@ Object { 65, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 25, "line": 4, }, "start": Object { - "column": 2, + "column": 24, "line": 4, }, }, "range": Array [ - 68, - 74, + 65, + 66, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 26, "line": 4, }, "start": Object { - "column": 9, + "column": 25, "line": 4, }, }, "range": Array [ - 75, - 81, + 66, + 67, ], - "type": "Identifier", - "value": "getBar", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 28, "line": 4, }, "start": Object { - "column": 16, + "column": 27, "line": 4, }, }, "range": Array [ - 82, - 83, + 68, + 69, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 30, "line": 4, }, "start": Object { - "column": 17, + "column": 29, "line": 4, }, }, "range": Array [ - 83, - 84, + 70, + 71, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 4, + "column": 1, + "line": 5, }, "start": Object { - "column": 19, - "line": 4, + "column": 0, + "line": 5, }, }, "range": Array [ - 85, - 86, + 72, + 73, ], "type": "Punctuator", - "value": "{", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-constructor-and-return-type.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 5, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 12, + 23, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 37, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 23, + 37, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 42, + 55, + ], + "raw": "'constructor'", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 41, + 70, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 67, + 70, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "params": Array [], + "range": Array [ + 56, + 70, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 58, + 66, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - "start": Object { - "column": 4, - "line": 5, + "range": Array [ + 8, + 72, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, - "range": Array [ - 91, - 97, - ], - "type": "Keyword", - "value": "return", - }, - Object { "loc": Object { "end": Object { - "column": 15, + "column": 1, "line": 5, }, "start": Object { - "column": 11, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 98, - 102, + 0, + 72, ], - "type": "Keyword", - "value": "this", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 73, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 5, + "line": 1, }, "start": Object { - "column": 15, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 102, - 103, + 0, + 5, ], - "type": "Punctuator", - "value": ".", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 7, + "line": 1, }, "start": Object { - "column": 16, - "line": 5, + "column": 6, + "line": 1, }, }, "range": Array [ - 103, - 106, + 6, + 7, ], "type": "Identifier", - "value": "bar", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { - "column": 19, - "line": 5, + "column": 8, + "line": 1, }, }, "range": Array [ - 106, - 107, + 8, + 9, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 13, + "line": 2, }, "start": Object { "column": 2, - "line": 6, + "line": 2, }, }, "range": Array [ - 110, - 111, + 12, + 23, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 7, + "column": 14, + "line": 2, }, "start": Object { - "column": 2, - "line": 7, + "column": 13, + "line": 2, }, }, "range": Array [ - 114, - 123, + 23, + 24, ], - "type": "Keyword", - "value": "protected", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { - "end": Object { - "column": 18, - "line": 7, + "end": Object { + "column": 15, + "line": 2, }, "start": Object { - "column": 12, - "line": 7, + "column": 14, + "line": 2, }, }, "range": Array [ - 124, - 130, + 24, + 25, ], - "type": "Identifier", - "value": "setBar", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 7, + "column": 16, + "line": 2, }, "start": Object { - "column": 19, - "line": 7, + "column": 15, + "line": 2, }, }, "range": Array [ - 131, - 132, + 25, + 26, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 7, + "line": 2, }, "start": Object { - "column": 20, - "line": 7, + "column": 17, + "line": 2, }, }, "range": Array [ - 132, - 135, + 27, + 33, ], "type": "Identifier", - "value": "bar", + "value": "number", }, Object { "loc": Object { "end": Object { "column": 25, - "line": 7, + "line": 2, }, "start": Object { "column": 24, - "line": 7, + "line": 2, }, }, "range": Array [ - 136, - 137, + 34, + 35, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 7, + "column": 27, + "line": 2, }, "start": Object { "column": 26, - "line": 7, + "line": 2, }, }, "range": Array [ - 138, - 144, + 36, + 37, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 7, + "column": 3, + "line": 4, }, "start": Object { - "column": 32, - "line": 7, + "column": 2, + "line": 4, }, }, "range": Array [ - 144, - 145, + 41, + 42, ], "type": "Punctuator", - "value": ")", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 7, + "column": 16, + "line": 4, }, "start": Object { - "column": 34, - "line": 7, + "column": 3, + "line": 4, }, }, "range": Array [ - 146, - 147, + 42, + 55, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "'constructor'", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 8, + "column": 17, + "line": 4, }, "start": Object { - "column": 4, - "line": 8, + "column": 16, + "line": 4, }, }, "range": Array [ - 152, - 156, + 55, + 56, ], - "type": "Keyword", - "value": "this", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 8, + "column": 18, + "line": 4, }, "start": Object { - "column": 8, - "line": 8, + "column": 17, + "line": 4, }, }, "range": Array [ - 156, - 157, + 56, + 57, ], "type": "Punctuator", - "value": ".", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 8, + "column": 19, + "line": 4, }, "start": Object { - "column": 9, - "line": 8, + "column": 18, + "line": 4, }, }, "range": Array [ - 157, - 160, + 57, + 58, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 20, + "line": 4, }, "start": Object { - "column": 13, - "line": 8, + "column": 19, + "line": 4, }, }, "range": Array [ - 161, - 162, + 58, + 59, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 8, + "column": 27, + "line": 4, }, "start": Object { - "column": 15, - "line": 8, + "column": 21, + "line": 4, }, }, "range": Array [ - 163, - 166, + 60, + 66, ], "type": "Identifier", - "value": "bar", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 8, + "column": 29, + "line": 4, }, "start": Object { - "column": 18, - "line": 8, + "column": 28, + "line": 4, }, }, "range": Array [ - 166, - 167, + 67, + 68, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 31, + "line": 4, }, "start": Object { - "column": 2, - "line": 9, + "column": 30, + "line": 4, }, }, "range": Array [ - 170, - 171, + 69, + 70, ], "type": "Punctuator", "value": "}", @@ -11124,16 +13491,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 10, + "line": 5, }, "start": Object { "column": 0, - "line": 10, + "line": 5, }, }, "range": Array [ - 172, - 173, + 71, + 72, ], "type": "Punctuator", "value": "}", @@ -11143,37 +13510,36 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-constructor-and-modifier.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { - "accessibility": "protected", "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 23, + "column": 13, "line": 2, }, "start": Object { - "column": 12, + "column": 2, "line": 2, }, }, "name": "constructor", "range": Array [ - 22, - 33, + 12, + 23, ], "type": "Identifier", }, "kind": "constructor", "loc": Object { "end": Object { - "column": 29, + "column": 22, "line": 2, }, "start": Object { @@ -11183,7 +13549,7 @@ Object { }, "range": Array [ 12, - 39, + 32, ], "static": false, "type": "MethodDefinition", @@ -11193,17 +13559,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 29, + "column": 22, "line": 2, }, "start": Object { - "column": 26, + "column": 19, "line": 2, }, }, "range": Array [ - 36, - 39, + 29, + 32, ], "type": "BlockStatement", }, @@ -11212,39 +13578,92 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 29, + "column": 22, "line": 2, }, "start": Object { - "column": 23, + "column": 13, "line": 2, }, }, "params": Array [], "range": Array [ - 33, - 39, + 23, + 32, ], "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "range": Array [ + 24, + 25, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 23, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, }, }, Object { - "accessibility": "public", "computed": true, "key": Object { "loc": Object { "end": Object { - "column": 23, + "column": 16, "line": 4, }, "start": Object { - "column": 10, + "column": 3, "line": 4, }, }, "range": Array [ - 51, - 64, + 37, + 50, ], "raw": "'constructor'", "type": "Literal", @@ -11253,7 +13672,7 @@ Object { "kind": "method", "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 4, }, "start": Object { @@ -11262,8 +13681,8 @@ Object { }, }, "range": Array [ - 43, - 71, + 36, + 60, ], "static": false, "type": "MethodDefinition", @@ -11273,17 +13692,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 4, }, "start": Object { - "column": 27, + "column": 23, "line": 4, }, }, "range": Array [ - 68, - 71, + 57, + 60, ], "type": "BlockStatement", }, @@ -11292,20 +13711,74 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 4, }, "start": Object { - "column": 24, + "column": 17, "line": 4, }, }, "params": Array [], "range": Array [ - 65, - 71, + 51, + 60, ], "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": "T", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + "range": Array [ + 52, + 53, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 51, + 54, + ], + "type": "TSTypeParameterDeclaration", + }, }, }, ], @@ -11321,7 +13794,7 @@ Object { }, "range": Array [ 8, - 73, + 62, ], "type": "ClassBody", }, @@ -11355,7 +13828,7 @@ Object { }, "range": Array [ 0, - 73, + 62, ], "superClass": null, "type": "ClassDeclaration", @@ -11373,7 +13846,7 @@ Object { }, "range": Array [ 0, - 74, + 63, ], "sourceType": "script", "tokens": Array [ @@ -11434,7 +13907,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 2, }, "start": Object { @@ -11444,43 +13917,79 @@ Object { }, "range": Array [ 12, - 21, + 23, ], - "type": "Keyword", - "value": "protected", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 14, "line": 2, }, "start": Object { - "column": 12, + "column": 13, "line": 2, }, }, "range": Array [ - 22, - 33, + 23, + 24, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, ], "type": "Identifier", - "value": "constructor", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 16, "line": 2, }, "start": Object { - "column": 23, + "column": 15, "line": 2, }, }, "range": Array [ - 33, - 34, + 25, + 26, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, ], "type": "Punctuator", "value": "(", @@ -11488,17 +13997,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 18, "line": 2, }, "start": Object { - "column": 24, + "column": 17, "line": 2, }, }, "range": Array [ - 34, - 35, + 27, + 28, ], "type": "Punctuator", "value": ")", @@ -11506,17 +14015,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 20, "line": 2, }, "start": Object { - "column": 26, + "column": 19, "line": 2, }, }, "range": Array [ - 36, - 37, + 29, + 30, ], "type": "Punctuator", "value": "{", @@ -11524,17 +14033,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 22, "line": 2, }, "start": Object { - "column": 28, + "column": 21, "line": 2, }, }, "range": Array [ - 38, - 39, + 31, + 32, ], "type": "Punctuator", "value": "}", @@ -11542,7 +14051,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 3, "line": 4, }, "start": Object { @@ -11551,20 +14060,38 @@ Object { }, }, "range": Array [ - 43, - 49, + 36, + 37, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 16, "line": 4, }, "start": Object { - "column": 9, + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 37, + 50, + ], + "type": "String", + "value": "'constructor'", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 16, "line": 4, }, }, @@ -11573,58 +14100,76 @@ Object { 51, ], "type": "Punctuator", - "value": "[", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 4, }, "start": Object { - "column": 10, + "column": 17, "line": 4, }, }, "range": Array [ 51, - 64, + 52, ], - "type": "String", - "value": "'constructor'", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 19, "line": 4, }, "start": Object { - "column": 23, + "column": 18, "line": 4, }, }, "range": Array [ - 64, - 65, + 52, + 53, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, ], "type": "Punctuator", - "value": "]", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 21, "line": 4, }, "start": Object { - "column": 24, + "column": 20, "line": 4, }, }, "range": Array [ - 65, - 66, + 54, + 55, ], "type": "Punctuator", "value": "(", @@ -11632,17 +14177,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, + "column": 22, "line": 4, }, "start": Object { - "column": 25, + "column": 21, "line": 4, }, }, "range": Array [ - 66, - 67, + 55, + 56, ], "type": "Punctuator", "value": ")", @@ -11650,17 +14195,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 4, }, "start": Object { - "column": 27, + "column": 23, "line": 4, }, }, "range": Array [ - 68, - 69, + 57, + 58, ], "type": "Punctuator", "value": "{", @@ -11668,17 +14213,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 4, }, "start": Object { - "column": 29, + "column": 25, "line": 4, }, }, "range": Array [ - 70, - 71, + 59, + 60, ], "type": "Punctuator", "value": "}", @@ -11695,8 +14240,8 @@ Object { }, }, "range": Array [ - 72, - 73, + 61, + 62, ], "type": "Punctuator", "value": "}", @@ -11706,7 +14251,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-constructor-and-return-type.src 1`] = ` +exports[`typescript fixtures/basics/class-with-declare-properties.src 1`] = ` Object { "body": Array [ Object { @@ -11714,28 +14259,28 @@ Object { "body": Array [ Object { "computed": false, + "declare": true, "key": Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 2, }, "start": Object { - "column": 2, + "column": 10, "line": 2, }, }, - "name": "constructor", + "name": "prop1", "range": Array [ - 12, - 23, + 28, + 33, ], "type": "Identifier", }, - "kind": "constructor", "loc": Object { "end": Object { - "column": 27, + "column": 24, "line": 2, }, "start": Object { @@ -11744,108 +14289,142 @@ Object { }, }, "range": Array [ - 12, - 37, + 20, + 42, ], "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 33, + 41, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 2, }, "start": Object { - "column": 24, + "column": 17, "line": 2, }, }, "range": Array [ - 34, - 37, + 35, + 41, ], - "type": "BlockStatement", + "type": "TSStringKeyword", }, - "expression": false, - "generator": false, - "id": null, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 22, + "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 17, + "line": 3, }, }, - "params": Array [], + "name": "prop2", "range": Array [ - 23, - 37, + 60, + 65, ], - "returnType": Object { + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 45, + 74, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 65, + 73, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 30, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 24, + "line": 3, }, }, "range": Array [ - 25, - 33, + 67, + 73, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 27, - 33, - ], - "type": "TSNumberKeyword", - }, + "type": "TSStringKeyword", }, - "type": "FunctionExpression", }, + "value": null, }, Object { - "computed": true, + "computed": false, + "declare": true, "key": Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 4, }, "start": Object { - "column": 3, + "column": 17, "line": 4, }, }, + "name": "prop3", "range": Array [ - 42, - 55, + 92, + 97, ], - "raw": "'constructor'", - "type": "Literal", - "value": "constructor", + "type": "Identifier", }, - "kind": "method", "loc": Object { "end": Object { "column": 31, @@ -11857,107 +14436,366 @@ Object { }, }, "range": Array [ - 41, - 70, + 77, + 106, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "static": true, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 22, + "line": 4, + }, + }, + "range": Array [ + 97, + 105, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, + "column": 30, "line": 4, }, "start": Object { - "column": 28, + "column": 24, "line": 4, }, }, "range": Array [ - 67, - 70, + 99, + 105, ], - "type": "BlockStatement", + "type": "TSStringKeyword", }, - "expression": false, - "generator": false, - "id": null, + }, + "value": null, + }, + Object { + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "name": "prop3", + "range": Array [ + 126, + 131, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 109, + 140, + ], + "readonly": true, + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 5, + }, + "start": Object { + "column": 24, + "line": 5, + }, + }, + "range": Array [ + 131, + 139, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 5, + }, + "start": Object { + "column": 26, + "line": 5, + }, + }, + "range": Array [ + 133, + 139, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { "loc": Object { "end": Object { "column": 31, - "line": 4, + "line": 6, }, "start": Object { - "column": 17, - "line": 4, + "column": 26, + "line": 6, + }, + }, + "name": "prop4", + "range": Array [ + 167, + 172, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 143, + 181, + ], + "readonly": true, + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 6, + }, + "start": Object { + "column": 31, + "line": 6, + }, + }, + "range": Array [ + 172, + 180, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 6, + }, + "start": Object { + "column": 33, + "line": 6, + }, + }, + "range": Array [ + 174, + 180, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 7, + }, + "start": Object { + "column": 24, + "line": 7, + }, + }, + "name": "prop5", + "range": Array [ + 206, + 211, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 184, + 220, + ], + "static": true, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 7, + }, + "start": Object { + "column": 29, + "line": 7, + }, + }, + "range": Array [ + 211, + 219, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 7, + }, + "start": Object { + "column": 31, + "line": 7, + }, + }, + "range": Array [ + 213, + 219, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 8, + }, + "start": Object { + "column": 33, + "line": 8, + }, + }, + "name": "prop6", + "range": Array [ + 254, + 259, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 223, + 268, + ], + "readonly": true, + "static": true, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 8, + }, + "start": Object { + "column": 38, + "line": 8, }, }, - "params": Array [], "range": Array [ - 56, - 70, + 259, + 267, ], - "returnType": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 27, - "line": 4, + "column": 46, + "line": 8, }, "start": Object { - "column": 19, - "line": 4, + "column": 40, + "line": 8, }, }, "range": Array [ - 58, - 66, + 261, + 267, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "range": Array [ - 60, - 66, - ], - "type": "TSNumberKeyword", - }, + "type": "TSStringKeyword", }, - "type": "FunctionExpression", }, + "value": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { - "column": 8, + "column": 16, "line": 1, }, }, "range": Array [ - 8, - 72, + 16, + 270, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 15, "line": 1, }, "start": Object { @@ -11965,17 +14803,17 @@ Object { "line": 1, }, }, - "name": "C", + "name": "DeclProps", "range": Array [ 6, - 7, + 15, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 0, @@ -11984,7 +14822,7 @@ Object { }, "range": Array [ 0, - 72, + 270, ], "superClass": null, "type": "ClassDeclaration", @@ -11993,7 +14831,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 10, }, "start": Object { "column": 0, @@ -12002,7 +14840,7 @@ Object { }, "range": Array [ 0, - 73, + 271, ], "sourceType": "script", "tokens": Array [ @@ -12027,7 +14865,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 15, "line": 1, }, "start": Object { @@ -12037,25 +14875,25 @@ Object { }, "range": Array [ 6, - 7, + 15, ], "type": "Identifier", - "value": "C", + "value": "DeclProps", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 17, "line": 1, }, "start": Object { - "column": 8, + "column": 16, "line": 1, }, }, "range": Array [ - 8, - 9, + 16, + 17, ], "type": "Punctuator", "value": "{", @@ -12063,7 +14901,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 9, "line": 2, }, "start": Object { @@ -12072,263 +14910,281 @@ Object { }, }, "range": Array [ - 12, - 23, + 20, + 27, ], "type": "Identifier", - "value": "constructor", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 2, }, "start": Object { - "column": 13, + "column": 10, "line": 2, }, }, "range": Array [ - 23, - 24, + 28, + 33, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "prop1", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 2, }, "start": Object { - "column": 14, + "column": 15, "line": 2, }, }, "range": Array [ - 24, - 25, + 33, + 34, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 2, }, "start": Object { - "column": 15, + "column": 17, "line": 2, }, }, "range": Array [ - 25, - 26, + 35, + 41, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 2, }, "start": Object { - "column": 17, + "column": 23, "line": 2, }, }, "range": Array [ - 27, - 33, + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 45, + 52, ], "type": "Identifier", - "value": "number", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 24, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 34, - 35, + 53, + 59, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 22, + "line": 3, }, "start": Object { - "column": 26, - "line": 2, + "column": 17, + "line": 3, }, }, "range": Array [ - 36, - 37, + 60, + 65, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "prop2", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 23, + "line": 3, }, "start": Object { - "column": 2, - "line": 4, + "column": 22, + "line": 3, }, }, "range": Array [ - 41, - 42, + 65, + 66, ], "type": "Punctuator", - "value": "[", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 4, + "column": 30, + "line": 3, }, "start": Object { - "column": 3, - "line": 4, + "column": 24, + "line": 3, }, }, "range": Array [ - 42, - 55, + 67, + 73, ], - "type": "String", - "value": "'constructor'", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 31, + "line": 3, }, "start": Object { - "column": 16, - "line": 4, + "column": 30, + "line": 3, }, }, "range": Array [ - 55, - 56, + 73, + 74, ], "type": "Punctuator", - "value": "]", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 9, "line": 4, }, "start": Object { - "column": 17, + "column": 2, "line": 4, }, }, "range": Array [ - 56, - 57, + 77, + 84, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 16, "line": 4, }, "start": Object { - "column": 18, + "column": 10, "line": 4, }, }, "range": Array [ - 57, - 58, + 85, + 91, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 22, "line": 4, }, "start": Object { - "column": 19, + "column": 17, "line": 4, }, }, "range": Array [ - 58, - 59, + 92, + 97, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "prop3", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 4, }, "start": Object { - "column": 21, + "column": 22, "line": 4, }, }, "range": Array [ - 60, - 66, + 97, + 98, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 30, "line": 4, }, "start": Object { - "column": 28, + "column": 24, "line": 4, }, }, "range": Array [ - 67, - 68, + 99, + 105, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { @@ -12342,767 +15198,530 @@ Object { }, }, "range": Array [ - 69, - 70, + 105, + 106, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 9, "line": 5, }, "start": Object { - "column": 0, + "column": 2, "line": 5, }, }, "range": Array [ - 71, - 72, + 109, + 116, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "declare", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "constructor", - "range": Array [ - 12, - 23, - ], - "type": "Identifier", - }, - "kind": "constructor", - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 12, - 32, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 29, - 32, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 23, - 32, - ], - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "name": "T", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - "range": Array [ - 24, - 25, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 23, - 26, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 4, - }, - "start": Object { - "column": 3, - "line": 4, - }, - }, - "range": Array [ - 37, - 50, - ], - "raw": "'constructor'", - "type": "Literal", - "value": "constructor", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 36, - 60, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 23, - "line": 4, - }, - }, - "range": Array [ - 57, - 60, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, - }, - }, - "params": Array [], - "range": Array [ - 51, - 60, - ], - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 4, - }, - "start": Object { - "column": 18, - "line": 4, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 4, - }, - "start": Object { - "column": 18, - "line": 4, - }, - }, - "name": "T", - "range": Array [ - 52, - 53, - ], - "type": "Identifier", - }, - "range": Array [ - 52, - 53, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 51, - 54, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 18, + "line": 5, }, - "range": Array [ - 8, - 62, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 10, + "line": 5, }, - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", }, + "range": Array [ + 117, + 125, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { "loc": Object { "end": Object { - "column": 1, + "column": 24, "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 19, + "line": 5, }, }, "range": Array [ - 0, - 62, + 126, + 131, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "prop3", }, - }, - "range": Array [ - 0, - 63, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 25, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 24, + "line": 5, }, }, "range": Array [ - 0, - 5, + 131, + 132, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 32, + "line": 5, }, "start": Object { - "column": 6, - "line": 1, + "column": 26, + "line": 5, }, }, "range": Array [ - 6, - 7, + 133, + 139, ], "type": "Identifier", - "value": "C", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 33, + "line": 5, }, "start": Object { - "column": 8, - "line": 1, + "column": 32, + "line": 5, }, }, "range": Array [ - 8, - 9, + 139, + 140, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 9, + "line": 6, }, "start": Object { "column": 2, - "line": 2, + "line": 6, }, }, "range": Array [ - 12, - 23, + 143, + 150, ], "type": "Identifier", - "value": "constructor", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 16, + "line": 6, }, "start": Object { - "column": 13, - "line": 2, + "column": 10, + "line": 6, }, }, "range": Array [ - 23, - 24, + 151, + 157, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 25, + "line": 6, }, "start": Object { - "column": 14, - "line": 2, + "column": 17, + "line": 6, }, }, "range": Array [ - 24, - 25, + 158, + 166, ], "type": "Identifier", - "value": "T", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 31, + "line": 6, }, "start": Object { - "column": 15, - "line": 2, + "column": 26, + "line": 6, }, }, "range": Array [ - 25, - 26, + 167, + 172, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "prop4", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 32, + "line": 6, }, "start": Object { - "column": 16, - "line": 2, + "column": 31, + "line": 6, }, }, "range": Array [ - 26, - 27, + 172, + 173, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 39, + "line": 6, }, "start": Object { - "column": 17, - "line": 2, + "column": 33, + "line": 6, }, }, "range": Array [ - 27, - 28, + 174, + 180, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 40, + "line": 6, }, "start": Object { - "column": 19, - "line": 2, + "column": 39, + "line": 6, }, }, "range": Array [ - 29, - 30, + 180, + 181, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 9, + "line": 7, }, "start": Object { - "column": 21, - "line": 2, + "column": 2, + "line": 7, }, }, "range": Array [ - 31, - 32, + 184, + 191, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 16, + "line": 7, }, "start": Object { - "column": 2, - "line": 4, + "column": 10, + "line": 7, }, }, "range": Array [ - 36, - 37, + 192, + 198, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 4, + "column": 23, + "line": 7, }, "start": Object { - "column": 3, - "line": 4, + "column": 17, + "line": 7, }, }, "range": Array [ - 37, - 50, + 199, + 205, ], - "type": "String", - "value": "'constructor'", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 29, + "line": 7, }, "start": Object { - "column": 16, - "line": 4, + "column": 24, + "line": 7, }, }, "range": Array [ - 50, - 51, + 206, + 211, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "prop5", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 30, + "line": 7, }, "start": Object { - "column": 17, - "line": 4, + "column": 29, + "line": 7, }, }, "range": Array [ - 51, - 52, + 211, + 212, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 37, + "line": 7, }, "start": Object { - "column": 18, - "line": 4, + "column": 31, + "line": 7, }, }, "range": Array [ - 52, - 53, + 213, + 219, ], "type": "Identifier", - "value": "T", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 4, + "column": 38, + "line": 7, }, "start": Object { - "column": 19, - "line": 4, + "column": 37, + "line": 7, }, }, "range": Array [ - 53, - 54, + 219, + 220, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 9, + "line": 8, }, "start": Object { - "column": 20, - "line": 4, + "column": 2, + "line": 8, }, }, "range": Array [ - 54, - 55, + 223, + 230, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 4, + "column": 16, + "line": 8, }, "start": Object { - "column": 21, - "line": 4, + "column": 10, + "line": 8, }, }, "range": Array [ - 55, - 56, + 231, + 237, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 8, + }, + "start": Object { + "column": 17, + "line": 8, + }, + }, + "range": Array [ + 238, + 244, + ], + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { + "column": 32, + "line": 8, + }, + "start": Object { "column": 24, - "line": 4, + "line": 8, + }, + }, + "range": Array [ + 245, + 253, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 8, }, "start": Object { - "column": 23, - "line": 4, + "column": 33, + "line": 8, }, }, "range": Array [ - 57, - 58, + 254, + 259, + ], + "type": "Identifier", + "value": "prop6", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 8, + }, + "start": Object { + "column": 38, + "line": 8, + }, + }, + "range": Array [ + 259, + 260, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 46, + "line": 8, }, "start": Object { - "column": 25, - "line": 4, + "column": 40, + "line": 8, }, }, "range": Array [ - 59, - 60, + 261, + 267, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 8, + }, + "start": Object { + "column": 46, + "line": 8, + }, + }, + "range": Array [ + 267, + 268, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 0, - "line": 5, + "line": 9, }, }, "range": Array [ - 61, - 62, + 269, + 270, ], "type": "Punctuator", "value": "}", @@ -13120,6 +15739,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "definite": true, "key": Object { "loc": Object { @@ -20795,6 +23415,7 @@ Object { Object { "accessibility": "private", "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22063,6 +24684,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22102,6 +24724,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22176,6 +24799,7 @@ Object { Object { "accessibility": "private", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22249,6 +24873,7 @@ Object { }, Object { "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22288,6 +24913,7 @@ Object { }, Object { "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22328,6 +24954,7 @@ Object { }, Object { "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22368,6 +24995,7 @@ Object { }, Object { "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22441,6 +25069,7 @@ Object { }, Object { "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -22515,6 +25144,7 @@ Object { }, Object { "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -23822,6 +26452,7 @@ Object { Object { "accessibility": "private", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -25263,6 +27894,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -25444,6 +28076,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -26121,6 +28754,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -26177,6 +28811,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -26232,6 +28867,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -26287,6 +28923,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -26343,6 +28980,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -30201,6 +32839,7 @@ Object { Object { "accessibility": "public", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -66262,6 +68901,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -80914,6 +83554,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -83434,6 +86075,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -86347,6 +88989,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -89936,6 +92579,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -108673,6 +111317,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -108767,6 +111412,7 @@ Object { }, Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -109354,6 +112000,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -109468,6 +112115,7 @@ Object { }, Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -110022,6 +112670,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -110097,6 +112746,7 @@ Object { }, Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -110468,6 +113118,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -110543,6 +113194,7 @@ Object { }, Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -145963,6 +148615,7 @@ Object { Object { "accessibility": "public", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object {