Skip to content

Commit 7f51f7c

Browse files
committed
Modified createIdentifier to track originalKeywordKind
1 parent 63cf58b commit 7f51f7c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/compiler/factory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ namespace ts {
138138
export function createIdentifier(text: string, location?: TextRange): Identifier {
139139
const node = <Identifier>createNode(SyntaxKind.Identifier, location);
140140
node.text = escapeIdentifier(text);
141+
node.originalKeywordKind = stringToToken(text);
141142
return node;
142143
}
143144

src/compiler/transformers/module/system.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace ts {
2626
context.enableExpressionSubstitution(SyntaxKind.PrefixUnaryExpression);
2727
context.enableExpressionSubstitution(SyntaxKind.PostfixUnaryExpression);
2828
context.expressionSubstitution = substituteExpression;
29-
29+
3030
context.enableEmitNotification(SyntaxKind.SourceFile);
3131

3232
const exportFunctionForFileMap: Identifier[] = [];
@@ -125,7 +125,7 @@ namespace ts {
125125
createStatement(
126126
createCall(
127127
createPropertyAccess(createIdentifier("System"), "register"),
128-
node.moduleName
128+
node.moduleName
129129
? [createLiteral(node.moduleName), dependencies, body]
130130
: [dependencies, body]
131131
)
@@ -626,7 +626,7 @@ namespace ts {
626626
if (!hasModifier(node, ModifierFlags.Default)) {
627627
recordExportName(name);
628628
}
629-
629+
630630
node = newNode;
631631
}
632632

@@ -1073,7 +1073,7 @@ namespace ts {
10731073
function substituteUnaryExpression(node: PrefixUnaryExpression | PostfixUnaryExpression): Expression {
10741074
const operand = node.operand;
10751075
const operator = node.operator;
1076-
const substitute =
1076+
const substitute =
10771077
isIdentifier(operand) &&
10781078
(
10791079
node.kind === SyntaxKind.PostfixUnaryExpression ||
@@ -1090,7 +1090,7 @@ namespace ts {
10901090
return call;
10911091
}
10921092
else {
1093-
return operator === SyntaxKind.PlusPlusToken
1093+
return operator === SyntaxKind.PlusPlusToken
10941094
? createSubtract(call, createLiteral(1))
10951095
: createAdd(call, createLiteral(1))
10961096
}
@@ -1200,7 +1200,7 @@ namespace ts {
12001200
)
12011201
)
12021202
],
1203-
/*location*/ undefined,
1203+
/*location*/ undefined,
12041204
/*multiline*/ true)
12051205
)
12061206
);
@@ -1243,7 +1243,6 @@ namespace ts {
12431243
if (isImportClause(importDeclaration)) {
12441244
importAlias = getGeneratedNameForNode(importDeclaration.parent);
12451245
name = createIdentifier("default");
1246-
name.originalKeywordKind = SyntaxKind.DefaultKeyword;
12471246
}
12481247
else if (isImportSpecifier(importDeclaration)) {
12491248
importAlias = getGeneratedNameForNode(importDeclaration.parent.parent.parent);

0 commit comments

Comments
 (0)