mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 05:55:11 -05:00
perf: reduce GC pressure by hoisting script target features object (#55484)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
This commit is contained in:
@@ -386,6 +386,7 @@ import {
|
||||
mapDefined,
|
||||
MapLike,
|
||||
MemberName,
|
||||
memoize,
|
||||
MetaProperty,
|
||||
MethodDeclaration,
|
||||
MethodSignature,
|
||||
@@ -1281,8 +1282,8 @@ export function getInternalEmitFlags(node: Node): InternalEmitFlags {
|
||||
export type ScriptTargetFeatures = ReadonlyMap<string, ReadonlyMap<string, string[]>>;
|
||||
|
||||
/** @internal */
|
||||
export function getScriptTargetFeatures(): ScriptTargetFeatures {
|
||||
return new Map(Object.entries({
|
||||
export const getScriptTargetFeatures = /* @__PURE__ */ memoize((): ScriptTargetFeatures =>
|
||||
new Map(Object.entries({
|
||||
Array: new Map(Object.entries({
|
||||
es2015: [
|
||||
"find",
|
||||
@@ -1675,8 +1676,8 @@ export function getScriptTargetFeatures(): ScriptTargetFeatures {
|
||||
"cause",
|
||||
],
|
||||
})),
|
||||
}));
|
||||
}
|
||||
}))
|
||||
);
|
||||
|
||||
/** @internal */
|
||||
export const enum GetLiteralTextFlags {
|
||||
|
||||
Reference in New Issue
Block a user