Skip to content

Fix transform flags for certain ES2020 features. #52445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/compiler/factory/nodeFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
function createBigIntLiteral(value: string | PseudoBigInt): BigIntLiteral {
const node = createBaseToken<BigIntLiteral>(SyntaxKind.BigIntLiteral);
node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n";
node.transformFlags |= TransformFlags.ContainsESNext;
node.transformFlags |= TransformFlags.ContainsES2020;
return node;
}

Expand Down Expand Up @@ -3695,7 +3695,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
node.transformFlags |= TransformFlags.ContainsES2015;
break;
case SyntaxKind.ImportKeyword:
node.transformFlags |= TransformFlags.ContainsESNext;
node.transformFlags |= TransformFlags.ContainsES2020;
break;
default:
return Debug.assertNever(keywordToken);
Expand Down Expand Up @@ -4735,7 +4735,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
node.name = name;
node.transformFlags |=
propagateChildFlags(node.name) |
TransformFlags.ContainsESNext;
TransformFlags.ContainsES2020;
node.transformFlags &= ~TransformFlags.ContainsPossibleTopLevelAwait; // always parsed in an Await context
return node;
}
Expand Down