Fix transform flags for certain ES2020 features. (#52445)

This commit is contained in:
Daniel Rosenwasser 2023-04-13 14:13:00 -07:00 committed by GitHub
parent 537cd60d9a
commit 1af17f8817
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1105,7 +1105,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;
}
@ -3675,7 +3675,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);
@ -4715,7 +4715,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;
}