add const keyword node and addresses
update snapshots for as-const
MODIFY
packages/@romefrontend/ast/index.ts
packages/@romefrontend/ast/index.ts
@@ -10,7 +10,7 @@ export * from "./unions";
export {bindingKeys, nodeNames, visitorKeys} from "./utils";
-// EVERYTHING BELOW IS AUTOGENERATED. SEE SCRIPTS FOLDER FOR UPDATE SCRIPTS hash(7622e2dc0a0cdbfece24a5cbd3bac901f222f7ec)
+// EVERYTHING BELOW IS AUTOGENERATED. SEE SCRIPTS FOLDER FOR UPDATE SCRIPTS hash(c26f0dc86f198e1372433d1b0bfa5cbfe7bc2ca7)
export * from "./common/comments/CommentBlock";
export * from "./common/comments/CommentLine";
@@ -237,6 +237,7 @@ export * from "./js/typescript/TSBooleanKeywordTypeAnnotation";
export * from "./js/typescript/TSBooleanLiteralTypeAnnotation";
export * from "./js/typescript/TSCallSignatureDeclaration";
export * from "./js/typescript/TSConditionalType";
+export * from "./js/typescript/TSConstKeyword";
export * from "./js/typescript/TSConstructorType";
export * from "./js/typescript/TSConstructSignatureDeclaration";
export * from "./js/typescript/TSDeclareFunction";
@@ -520,6 +521,7 @@ export type AnyNode =
| n.TSBooleanLiteralTypeAnnotation
| n.TSCallSignatureDeclaration
| n.TSConditionalType
+ | n.TSConstKeyword
| n.TSConstructorType
| n.TSConstructSignatureDeclaration
| n.TSDeclareFunction

ADD
packages/@romefrontend/ast/js/typescript/TSConstKeyword.ts
+import {NodeBaseWithComments} from "@romefrontend/ast";
+import {createBuilder} from "../../utils";
+
+export type TSConstKeyword = NodeBaseWithComments & {
+ type: "TSConstKeyword";
+};
+
+export const tsConstKeyword = createBuilder<TSConstKeyword>(
+ "TSConstKeyword",
+ {
+ bindingKeys: {},
+ visitorKeys: {},
+ },
+);

MODIFY
packages/@romefrontend/ast/js/unions.ts
packages/@romefrontend/ast/js/unions.ts
@@ -283,6 +283,7 @@ export type AnyTSPrimary =
| n.TSConstructorType
| n.TSIntersectionTypeAnnotation
| n.TSTemplateLiteralTypeAnnotation
+ | n.TSConstKeyword
| AnyTSLiteralTypeAnnotation
| AnyTSKeywordTypeAnnotation;

MODIFY
packages/@romefrontend/formatter/builders/index.ts
packages/@romefrontend/formatter/builders/index.ts
@@ -12,7 +12,7 @@ const builders: Map<string, BuilderMethod<any>> = new Map();
export default builders;
-// EVERYTHING BELOW IS AUTOGENERATED. SEE SCRIPTS FOLDER FOR UPDATE SCRIPTS hash(89e116f0c0ff27d01fb16c14e1ef9af07432336d)
+// EVERYTHING BELOW IS AUTOGENERATED. SEE SCRIPTS FOLDER FOR UPDATE SCRIPTS hash(25987a4bfad7a3d2992db56e46e858b193cf69e8)
import CommentBlock from "./common/comments/CommentBlock";
builders.set("CommentBlock", CommentBlock);
@@ -476,6 +476,8 @@ import TSCallSignatureDeclaration from "./js/typescript/TSCallSignatureDeclarati
builders.set("TSCallSignatureDeclaration", TSCallSignatureDeclaration);
import TSConditionalType from "./js/typescript/TSConditionalType";
builders.set("TSConditionalType", TSConditionalType);
+import TSConstKeyword from "./js/typescript/TSConstKeyword";
+builders.set("TSConstKeyword", TSConstKeyword);
import TSConstructorType from "./js/typescript/TSConstructorType";
builders.set("TSConstructorType", TSConstructorType);
import TSConstructSignatureDeclaration from "./js/typescript/TSConstructSignatureDeclaration";

ADD
packages/@romefrontend/formatter/builders/js/typescript/TSConstKeyword.ts
+import {TSConstKeyword} from "@romefrontend/ast";
+import {Token} from "@romefrontend/formatter";
+
+export default function TSConstKeyword(): Token {
+ return "const";
+}

MODIFY
packages/@romefrontend/js-analysis/evaluators/index.ts
packages/@romefrontend/js-analysis/evaluators/index.ts
@@ -16,7 +16,7 @@ const evaluators: Map<
> = new Map();
export default evaluators;
-// EVERYTHING BELOW IS AUTOGENERATED. SEE SCRIPTS FOLDER FOR UPDATE SCRIPTS hash(3990ed1de929b550277f996cc7a404dd14c5ed53)
+// EVERYTHING BELOW IS AUTOGENERATED. SEE SCRIPTS FOLDER FOR UPDATE SCRIPTS hash(45450e651626dbf814580877b1060c5183aba298)
import JSAmbiguousFlowTypeCastExpression from "./temp/JSAmbiguousFlowTypeCastExpression";
evaluators.set(
@@ -327,6 +327,8 @@ import TSCallSignatureDeclaration from "./typescript/TSCallSignatureDeclaration"
evaluators.set("TSCallSignatureDeclaration", TSCallSignatureDeclaration);
import TSConditionalType from "./typescript/TSConditionalType";
evaluators.set("TSConditionalType", TSConditionalType);
+import TSConstKeyword from "./typescript/TSConstKeyword";
+evaluators.set("TSConstKeyword", TSConstKeyword);
import TSConstructorType from "./typescript/TSConstructorType";
evaluators.set("TSConstructorType", TSConstructorType);
import TSConstructSignatureDeclaration from "./typescript/TSConstructSignatureDeclaration";

ADD
packages/@romefrontend/js-analysis/evaluators/typescript/TSConstKeyword.ts
+import {Scope} from "../../scopes";
+import {AnyNode, TSConstKeyword, tsConstKeyword} from "@romefrontend/ast";
+
+export default function TSConstKeyword(node: AnyNode, scope: Scope) {
+ node = tsConstKeyword.assert(node);
+ scope;
+ throw new Error("unimplemented");
+}

MODIFY
packages/@romefrontend/js-parser/parser/expression.ts
packages/@romefrontend/js-parser/parser/expression.ts
@@ -83,6 +83,7 @@ import {
JSYieldExpression,
LogicalOperator,
TSAsExpression,
+ TSConstKeyword,
TSDeclareFunction,
TSDeclareMethod,
TSTypeParameterInstantiation,
@@ -3449,6 +3450,20 @@ export function parseReferenceIdentifier(
return toReferenceIdentifier(parser, parseIdentifier(parser, liberal));
}
+export function parseTSConstKeyword(parser: JSParser): TSConstKeyword {
+ return toTSConstKeyword(parser, parseIdentifier(parser));
+}
+
+export function toTSConstKeyword(
+ parser: JSParser,
+ node: JSReferenceIdentifier | JSIdentifier | JSBindingIdentifier,
+): TSConstKeyword {
+ return parser.finalizeNode({
+ ...node,
+ type: "TSConstKeyword",
+ });
+}
+
export function toBindingIdentifier(
parser: JSParser,
node: JSReferenceIdentifier | JSIdentifier | JSAssignmentIdentifier,

MODIFY
packages/@romefrontend/js-parser/parser/typescript.ts
packages/@romefrontend/js-parser/parser/typescript.ts
@@ -26,6 +26,7 @@ import {
parseObjectPropertyKey,
parseReferenceIdentifier,
parseStringLiteral,
+ parseTSConstKeyword,
parseTemplate,
parseVarStatement,
toBindingIdentifier,
@@ -54,6 +55,7 @@ import {
JSVariableDeclarationKind,
JSVariableDeclarationStatement,
TSCallSignatureDeclaration,
+ TSConstKeyword,
TSConstructSignatureDeclaration,
TSConstructorType,
TSDeclareFunction,
@@ -541,10 +543,10 @@ export function parseTSTypeParameters(
export function tryTSNextParseConstantContext(
parser: JSParser,
-): undefined | TSTypeReference {
+): undefined | TSConstKeyword {
if (parser.lookaheadState().tokenType === tt._const) {
parser.next();
- return parseTSTypeReference(parser);
+ return parseTSConstKeyword(parser);
} else {
return undefined;
}
@@ -1244,7 +1246,6 @@ function parseTSNonArrayType(parser: JSParser): AnyTSPrimary {
description: descriptions.JS_PARSER.TS_UNKNOWN_NON_ARRAY_START,
});
parser.next();
-
return parser.finishNode(
parser.getPosition(),
{

MODIFY
packages/@romefrontend/js-parser/test-fixtures/typescript/cast/as-const/input.test.md
packages/@romefrontend/js-parser/test-fixtures/typescript/cast/as-const/input.test.md
@@ -182,22 +182,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 23
- index: 166
- line: 3
- }
- start: Object {
- column: 18
- index: 161
- line: 3
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -216,7 +201,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -295,22 +279,7 @@ JSRoot {
line: 4
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 23
- index: 191
- line: 4
- }
- start: Object {
- column: 18
- index: 186
- line: 4
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -327,7 +296,6 @@ JSRoot {
}
}
}
- }
expression: JSTemplateLiteral {
expressions: Array []
loc: Object {
@@ -461,22 +429,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 20
- index: 213
- line: 5
- }
- start: Object {
- column: 15
- index: 208
- line: 5
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -495,7 +448,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -574,22 +526,7 @@ JSRoot {
line: 6
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 21
- index: 236
- line: 6
- }
- start: Object {
- column: 16
- index: 231
- line: 6
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -606,7 +543,6 @@ JSRoot {
}
}
}
- }
expression: JSUnaryExpression {
operator: "-"
prefix: true
@@ -721,22 +657,7 @@ JSRoot {
line: 7
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 21
- index: 259
- line: 7
- }
- start: Object {
- column: 16
- index: 254
- line: 7
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -753,7 +674,6 @@ JSRoot {
}
}
}
- }
expression: JSUnaryExpression {
operator: "+"
prefix: true
@@ -885,22 +805,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 20
- index: 281
- line: 8
- }
- start: Object {
- column: 15
- index: 276
- line: 8
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -919,7 +824,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -998,22 +902,7 @@ JSRoot {
line: 9
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 21
- index: 304
- line: 9
- }
- start: Object {
- column: 16
- index: 299
- line: 9
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -1030,7 +919,6 @@ JSRoot {
}
}
}
- }
expression: JSUnaryExpression {
operator: "-"
prefix: true
@@ -1161,22 +1049,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 22
- index: 328
- line: 10
- }
- start: Object {
- column: 17
- index: 323
- line: 10
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -1195,7 +1068,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -1290,22 +1162,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 23
- index: 353
- line: 11
- }
- start: Object {
- column: 18
- index: 348
- line: 11
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -1324,7 +1181,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -1419,22 +1275,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 20
- index: 376
- line: 13
- }
- start: Object {
- column: 15
- index: 371
- line: 13
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -1453,7 +1294,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -1532,22 +1372,7 @@ JSRoot {
line: 14
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 27
- index: 405
- line: 14
- }
- start: Object {
- column: 22
- index: 400
- line: 14
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -1564,7 +1389,6 @@ JSRoot {
}
}
}
- }
expression: JSArrayExpression {
loc: Object {
filename: "input.ts"
@@ -1713,22 +1537,7 @@ JSRoot {
line: 15
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 37
- index: 444
- line: 15
- }
- start: Object {
- column: 32
- index: 439
- line: 15
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -1745,7 +1554,6 @@ JSRoot {
}
}
}
- }
expression: JSArrayExpression {
loc: Object {
filename: "input.ts"
@@ -1892,22 +1700,7 @@ JSRoot {
line: 16
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 32
- index: 478
- line: 16
- }
- start: Object {
- column: 27
- index: 473
- line: 16
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -1924,7 +1717,6 @@ JSRoot {
}
}
}
- }
expression: JSArrayExpression {
loc: Object {
filename: "input.ts"
@@ -2238,22 +2030,7 @@ JSRoot {
line: 18
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 25
- index: 525
- line: 18
- }
- start: Object {
- column: 20
- index: 520
- line: 18
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -2270,7 +2047,6 @@ JSRoot {
}
}
}
- }
expression: JSArrayExpression {
loc: Object {
filename: "input.ts"
@@ -2400,22 +2176,7 @@ JSRoot {
line: 19
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 32
- index: 559
- line: 19
- }
- start: Object {
- column: 27
- index: 554
- line: 19
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -2432,7 +2193,6 @@ JSRoot {
}
}
}
- }
expression: JSArrayExpression {
loc: Object {
filename: "input.ts"
@@ -2578,22 +2338,7 @@ JSRoot {
line: 21
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 34
- index: 596
- line: 21
- }
- start: Object {
- column: 29
- index: 591
- line: 21
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -2610,7 +2355,6 @@ JSRoot {
}
}
}
- }
expression: JSObjectExpression {
loc: Object {
filename: "input.ts"
@@ -2836,22 +2580,7 @@ JSRoot {
line: 22
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 67
- index: 665
- line: 22
- }
- start: Object {
- column: 62
- index: 660
- line: 22
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -2868,7 +2597,6 @@ JSRoot {
}
}
}
- }
expression: JSObjectExpression {
loc: Object {
filename: "input.ts"
@@ -3339,22 +3067,7 @@ JSRoot {
line: 23
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 34
- index: 701
- line: 23
- }
- start: Object {
- column: 29
- index: 696
- line: 23
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -3371,7 +3084,6 @@ JSRoot {
}
}
}
- }
expression: JSObjectExpression {
loc: Object {
filename: "input.ts"
@@ -3533,22 +3245,7 @@ JSRoot {
line: 24
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 27
- index: 730
- line: 24
- }
- start: Object {
- column: 22
- index: 725
- line: 24
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -3565,7 +3262,6 @@ JSRoot {
}
}
}
- }
expression: JSObjectExpression {
loc: Object {
filename: "input.ts"
@@ -3695,22 +3391,7 @@ JSRoot {
line: 25
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 26
- index: 758
- line: 25
- }
- start: Object {
- column: 21
- index: 753
- line: 25
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -3727,7 +3408,6 @@ JSRoot {
}
}
}
- }
expression: JSObjectExpression {
loc: Object {
filename: "input.ts"
@@ -3859,22 +3539,7 @@ JSRoot {
line: 26
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 50
- index: 810
- line: 26
- }
- start: Object {
- column: 45
- index: 805
- line: 26
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -3891,7 +3556,6 @@ JSRoot {
}
}
}
- }
expression: JSObjectExpression {
loc: Object {
filename: "input.ts"
@@ -4274,22 +3938,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 22
- index: 845
- line: 28
- }
- start: Object {
- column: 17
- index: 840
- line: 28
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -4308,7 +3957,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -4387,22 +4035,7 @@ JSRoot {
line: 29
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 25
- index: 872
- line: 29
- }
- start: Object {
- column: 20
- index: 867
- line: 29
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -4419,7 +4052,6 @@ JSRoot {
}
}
}
- }
expression: JSUnaryExpression {
operator: "-"
prefix: true
@@ -4534,22 +4166,7 @@ JSRoot {
line: 30
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 26
- index: 900
- line: 30
- }
- start: Object {
- column: 21
- index: 895
- line: 30
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -4566,7 +4183,6 @@ JSRoot {
}
}
}
- }
expression: JSArrayExpression {
loc: Object {
filename: "input.ts"
@@ -4681,22 +4297,7 @@ JSRoot {
line: 31
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 28
- index: 930
- line: 31
- }
- start: Object {
- column: 23
- index: 925
- line: 31
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -4713,7 +4314,6 @@ JSRoot {
}
}
}
- }
expression: JSArrayExpression {
loc: Object {
filename: "input.ts"
@@ -4879,22 +4479,7 @@ JSRoot {
line: 33
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 61
- index: 994
- line: 33
- }
- start: Object {
- column: 56
- index: 989
- line: 33
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -4911,7 +4496,6 @@ JSRoot {
}
}
}
- }
expression: JSObjectExpression {
loc: Object {
filename: "input.ts"
@@ -5380,22 +4964,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 15
- index: 1_012
- line: 35
- }
- start: Object {
- column: 10
- index: 1_007
- line: 35
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -5414,7 +4983,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -5509,22 +5077,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 15
- index: 1_033
- line: 36
- }
- start: Object {
- column: 10
- index: 1_028
- line: 36
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -5543,7 +5096,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -5638,22 +5190,7 @@ JSRoot {
}
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 15
- index: 1_057
- line: 37
- }
- start: Object {
- column: 10
- index: 1_052
- line: 37
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -5672,7 +5209,6 @@ JSRoot {
}
}
}
- }
]
}
}
@@ -5751,22 +5287,7 @@ JSRoot {
line: 38
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 15
- index: 1_080
- line: 38
- }
- start: Object {
- column: 10
- index: 1_075
- line: 38
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -5783,7 +5304,6 @@ JSRoot {
}
}
}
- }
expression: JSArrayExpression {
loc: Object {
filename: "input.ts"
@@ -5932,22 +5452,7 @@ JSRoot {
line: 39
}
}
- typeAnnotation: TSTypeReference {
- typeParameters: undefined
- loc: Object {
- filename: "input.ts"
- end: Object {
- column: 15
- index: 1_108
- line: 39
- }
- start: Object {
- column: 10
- index: 1_103
- line: 39
- }
- }
- typeName: JSReferenceIdentifier {
+ typeAnnotation: TSConstKeyword {
name: "const"
loc: Object {
filename: "input.ts"
@@ -5964,7 +5469,6 @@ JSRoot {
}
}
}
- }
expression: JSObjectExpression {
loc: Object {
filename: "input.ts"

add const keyword node and addresses #766 (#838)

update snapshots for as-const